summaryrefslogtreecommitdiffstats
path: root/Sluift
diff options
context:
space:
mode:
Diffstat (limited to 'Sluift')
-rw-r--r--Sluift/Console.h8
-rw-r--r--Sluift/EditlineTerminal.h12
-rw-r--r--Sluift/ElementConvertors/BodyConvertor.h9
-rw-r--r--Sluift/ElementConvertors/CarbonsReceivedConvertor.h11
-rw-r--r--Sluift/ElementConvertors/CarbonsSentConvertor.h11
-rw-r--r--Sluift/ElementConvertors/CommandConvertor.h9
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.cpp8
-rw-r--r--Sluift/ElementConvertors/DOMElementConvertor.h9
-rw-r--r--Sluift/ElementConvertors/DefaultElementConvertor.h10
-rw-r--r--Sluift/ElementConvertors/DelayConvertor.h9
-rw-r--r--Sluift/ElementConvertors/DiscoInfoConvertor.h9
-rw-r--r--Sluift/ElementConvertors/DiscoItemsConvertor.h9
-rw-r--r--Sluift/ElementConvertors/FormConvertor.cpp4
-rw-r--r--Sluift/ElementConvertors/FormConvertor.h9
-rw-r--r--Sluift/ElementConvertors/ForwardedConvertor.h12
-rw-r--r--Sluift/ElementConvertors/IQConvertor.h11
-rw-r--r--Sluift/ElementConvertors/IsodeIQDelegationConvertor.h11
-rw-r--r--Sluift/ElementConvertors/MAMFinConvertor.h11
-rw-r--r--Sluift/ElementConvertors/MAMQueryConvertor.h11
-rw-r--r--Sluift/ElementConvertors/MAMResultConvertor.h11
-rw-r--r--Sluift/ElementConvertors/MessageConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PresenceConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubAffiliationsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubConfigureConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubCreateConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubDefaultConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventAssociateConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventCollectionConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventConvertor.h9
-rw-r--r--Sluift/ElementConvertors/PubSubEventDeleteConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp4
-rw-r--r--Sluift/ElementConvertors/PubSubEventItemsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventPurgeConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventRedirectConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventRetractConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubItemConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubItemConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubItemsConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubItemsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOptionsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubPublishConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubPublishConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubRetractConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubRetractConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h11
-rw-r--r--Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h11
-rw-r--r--Sluift/ElementConvertors/RawXMLElementConvertor.h9
-rw-r--r--Sluift/ElementConvertors/ResultSetConvertor.h11
-rw-r--r--Sluift/ElementConvertors/SecurityLabelConvertor.cpp2
-rw-r--r--Sluift/ElementConvertors/SecurityLabelConvertor.h11
-rw-r--r--Sluift/ElementConvertors/SoftwareVersionConvertor.h9
-rw-r--r--Sluift/ElementConvertors/StanzaConvertor.h2
-rw-r--r--Sluift/ElementConvertors/StatusConvertor.h9
-rw-r--r--Sluift/ElementConvertors/StatusShowConvertor.h9
-rw-r--r--Sluift/ElementConvertors/SubjectConvertor.h9
-rw-r--r--Sluift/ElementConvertors/UserLocationConvertor.h11
-rw-r--r--Sluift/ElementConvertors/UserTuneConvertor.h11
-rw-r--r--Sluift/ElementConvertors/VCardConvertor.h9
-rw-r--r--Sluift/ElementConvertors/VCardUpdateConvertor.h9
-rw-r--r--Sluift/Examples/SendReference.lua74
-rw-r--r--Sluift/GenericLuaElementConvertor.h10
-rw-r--r--Sluift/Helpers.h3
-rw-r--r--Sluift/Lua/FunctionRegistration.h3
-rw-r--r--Sluift/Lua/FunctionRegistry.h4
-rw-r--r--Sluift/Lua/LuaUtils.h17
-rw-r--r--Sluift/LuaElementConvertor.h4
-rw-r--r--Sluift/LuaElementConvertors.h4
-rw-r--r--Sluift/SConscript2
-rw-r--r--Sluift/SluiftClient.cpp20
-rw-r--r--Sluift/SluiftClient.h15
-rw-r--r--Sluift/SluiftComponent.cpp13
-rw-r--r--Sluift/SluiftComponent.h6
-rw-r--r--Sluift/StandardTerminal.h12
-rw-r--r--Sluift/client.cpp38
-rw-r--r--Sluift/component.cpp13
-rw-r--r--Sluift/core.lua5
98 files changed, 522 insertions, 464 deletions
diff --git a/Sluift/Console.h b/Sluift/Console.h
index 6ed6f58..0d5ceb0 100644
--- a/Sluift/Console.h
+++ b/Sluift/Console.h
@@ -1,30 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
#include <string>
#include <boost/optional/optional.hpp>
-#include <Swiften/Base/Override.h>
-
#include <Sluift/Completer.h>
struct lua_State;
namespace Swift {
class Terminal;
class Console : public Completer {
public:
Console(lua_State* L, Terminal* terminal);
- virtual ~Console();
+ virtual ~Console() override;
void run();
static int call(lua_State* L, int numberOfArguments, bool keepResult);
@@ -32,11 +30,11 @@ namespace Swift {
std::string getPrompt(bool firstLine) const;
std::string getErrorMessage() const;
bool readCommand();
int tryLoadCommand(const std::string& command);
- virtual std::vector<std::string> getCompletions(const std::string&, int start, int end) SWIFTEN_OVERRIDE;
+ virtual std::vector<std::string> getCompletions(const std::string&, int start, int end) override;
private:
lua_State* L;
Terminal* terminal;
int previousNumberOfReturnArguments;
diff --git a/Sluift/EditlineTerminal.h b/Sluift/EditlineTerminal.h
index ec4cf63..8f4624b 100644
--- a/Sluift/EditlineTerminal.h
+++ b/Sluift/EditlineTerminal.h
@@ -1,26 +1,24 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-
#include <Sluift/Terminal.h>
namespace Swift {
class EditlineTerminal : public Terminal {
public:
static EditlineTerminal& getInstance();
private:
EditlineTerminal();
- virtual ~EditlineTerminal();
+ virtual ~EditlineTerminal() override;
- virtual boost::optional<std::string> readLine(const std::string& prompt) SWIFTEN_OVERRIDE;
- virtual void printError(const std::string& message) SWIFTEN_OVERRIDE;
- virtual void addToHistory(const std::string& command) SWIFTEN_OVERRIDE;
+ virtual boost::optional<std::string> readLine(const std::string& prompt) override;
+ virtual void printError(const std::string& message) override;
+ virtual void addToHistory(const std::string& command) override;
};
}
diff --git a/Sluift/ElementConvertors/BodyConvertor.h b/Sluift/ElementConvertors/BodyConvertor.h
index 64ff4d0..574fca9 100644
--- a/Sluift/ElementConvertors/BodyConvertor.h
+++ b/Sluift/ElementConvertors/BodyConvertor.h
@@ -1,25 +1,24 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Body.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class BodyConvertor : public GenericLuaElementConvertor<Body> {
public:
BodyConvertor();
- virtual ~BodyConvertor();
+ virtual ~BodyConvertor() override;
- virtual std::shared_ptr<Body> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Body>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Body> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Body>) override;
};
}
diff --git a/Sluift/ElementConvertors/CarbonsReceivedConvertor.h b/Sluift/ElementConvertors/CarbonsReceivedConvertor.h
index f18f699..cc4e6dc 100644
--- a/Sluift/ElementConvertors/CarbonsReceivedConvertor.h
+++ b/Sluift/ElementConvertors/CarbonsReceivedConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2016 Isode Limited.
+ * Copyright (c) 2016-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/CarbonsReceived.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class CarbonsReceivedConvertor : public GenericLuaElementConvertor<CarbonsReceived> {
public:
CarbonsReceivedConvertor(LuaElementConvertors* convertors);
- virtual ~CarbonsReceivedConvertor();
+ virtual ~CarbonsReceivedConvertor() override;
- virtual std::shared_ptr<CarbonsReceived> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<CarbonsReceived>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<CarbonsReceived> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<CarbonsReceived>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/CarbonsSentConvertor.h b/Sluift/ElementConvertors/CarbonsSentConvertor.h
index a36a6a8..794e0ed 100644
--- a/Sluift/ElementConvertors/CarbonsSentConvertor.h
+++ b/Sluift/ElementConvertors/CarbonsSentConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2016 Isode Limited.
+ * Copyright (c) 2016-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/CarbonsSent.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class CarbonsSentConvertor : public GenericLuaElementConvertor<CarbonsSent> {
public:
CarbonsSentConvertor(LuaElementConvertors* convertors);
- virtual ~CarbonsSentConvertor();
+ virtual ~CarbonsSentConvertor() override;
- virtual std::shared_ptr<CarbonsSent> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<CarbonsSent>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<CarbonsSent> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<CarbonsSent>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/CommandConvertor.h b/Sluift/ElementConvertors/CommandConvertor.h
index 1b0d481..274eaa6 100644
--- a/Sluift/ElementConvertors/CommandConvertor.h
+++ b/Sluift/ElementConvertors/CommandConvertor.h
@@ -1,28 +1,27 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Command.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class CommandConvertor : public GenericLuaElementConvertor<Command> {
public:
CommandConvertor(LuaElementConvertors* convertors);
- virtual ~CommandConvertor();
+ virtual ~CommandConvertor() override;
- virtual std::shared_ptr<Command> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Command>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Command> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Command>) override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/DOMElementConvertor.cpp b/Sluift/ElementConvertors/DOMElementConvertor.cpp
index b957686..56b45aa 100644
--- a/Sluift/ElementConvertors/DOMElementConvertor.cpp
+++ b/Sluift/ElementConvertors/DOMElementConvertor.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Sluift/ElementConvertors/DOMElementConvertor.h>
@@ -32,11 +32,11 @@ namespace {
ParserClient(lua_State* L) : L(L), currentIndex(1) {
}
virtual void handleStartElement(
const std::string& element, const std::string& ns,
- const AttributeMap& attributes) SWIFTEN_OVERRIDE {
+ const AttributeMap& attributes) override {
lua_checkstack(L, 6);
lua_pushnumber(L, currentIndex);
lua_newtable(L);
lua_pushstring(L, element.c_str());
lua_setfield(L, -2, "tag");
@@ -68,19 +68,19 @@ namespace {
currentIndex = 1;
lua_newtable(L);
}
virtual void handleEndElement(
- const std::string&, const std::string&) SWIFTEN_OVERRIDE {
+ const std::string&, const std::string&) override {
lua_setfield(L, -2, "children");
lua_settable(L, -3);
currentIndex = indexStack.back();
indexStack.pop_back();
currentIndex++;
}
- virtual void handleCharacterData(const std::string& data) SWIFTEN_OVERRIDE {
+ virtual void handleCharacterData(const std::string& data) override {
lua_checkstack(L, 2);
lua_pushnumber(L, currentIndex);
lua_pushstring(L, data.c_str());
lua_settable(L, -3);
currentIndex++;
diff --git a/Sluift/ElementConvertors/DOMElementConvertor.h b/Sluift/ElementConvertors/DOMElementConvertor.h
index 7b1ba58..dd8d79b 100644
--- a/Sluift/ElementConvertors/DOMElementConvertor.h
+++ b/Sluift/ElementConvertors/DOMElementConvertor.h
@@ -1,27 +1,26 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Parser/PlatformXMLParserFactory.h>
#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>
#include <Sluift/LuaElementConvertor.h>
namespace Swift {
class DOMElementConvertor : public LuaElementConvertor {
public:
DOMElementConvertor();
- virtual ~DOMElementConvertor();
+ virtual ~DOMElementConvertor() override;
- virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) override;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) override;
private:
PlatformXMLParserFactory parsers;
FullPayloadSerializerCollection serializers;
};
diff --git a/Sluift/ElementConvertors/DefaultElementConvertor.h b/Sluift/ElementConvertors/DefaultElementConvertor.h
index 4aec300..dfef3e8 100644
--- a/Sluift/ElementConvertors/DefaultElementConvertor.h
+++ b/Sluift/ElementConvertors/DefaultElementConvertor.h
@@ -1,22 +1,20 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-
#include <Sluift/LuaElementConvertor.h>
namespace Swift {
class DefaultElementConvertor : public LuaElementConvertor {
public:
DefaultElementConvertor();
- virtual ~DefaultElementConvertor();
+ virtual ~DefaultElementConvertor() override;
- virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) override;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) override;
};
}
diff --git a/Sluift/ElementConvertors/DelayConvertor.h b/Sluift/ElementConvertors/DelayConvertor.h
index b9f72f2..ad340da 100644
--- a/Sluift/ElementConvertors/DelayConvertor.h
+++ b/Sluift/ElementConvertors/DelayConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Delay.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class DelayConvertor : public GenericLuaElementConvertor<Delay> {
public:
DelayConvertor();
- virtual ~DelayConvertor();
+ virtual ~DelayConvertor() override;
- virtual std::shared_ptr<Delay> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Delay>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Delay> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Delay>) override;
};
}
diff --git a/Sluift/ElementConvertors/DiscoInfoConvertor.h b/Sluift/ElementConvertors/DiscoInfoConvertor.h
index c1b2910..b0e0849 100644
--- a/Sluift/ElementConvertors/DiscoInfoConvertor.h
+++ b/Sluift/ElementConvertors/DiscoInfoConvertor.h
@@ -4,26 +4,25 @@
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class DiscoInfoConvertor : public GenericLuaElementConvertor<DiscoInfo> {
public:
DiscoInfoConvertor(LuaElementConvertors* convertors);
- virtual ~DiscoInfoConvertor();
+ virtual ~DiscoInfoConvertor() override;
- virtual std::shared_ptr<DiscoInfo> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoInfo>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<DiscoInfo> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoInfo>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/DiscoItemsConvertor.h b/Sluift/ElementConvertors/DiscoItemsConvertor.h
index a77b948..98dcb5c 100644
--- a/Sluift/ElementConvertors/DiscoItemsConvertor.h
+++ b/Sluift/ElementConvertors/DiscoItemsConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/DiscoItems.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class DiscoItemsConvertor : public GenericLuaElementConvertor<DiscoItems> {
public:
DiscoItemsConvertor();
- virtual ~DiscoItemsConvertor();
+ virtual ~DiscoItemsConvertor() override;
- virtual std::shared_ptr<DiscoItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoItems>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<DiscoItems> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<DiscoItems>) override;
};
}
diff --git a/Sluift/ElementConvertors/FormConvertor.cpp b/Sluift/ElementConvertors/FormConvertor.cpp
index 90fd9fe..245e0f9 100644
--- a/Sluift/ElementConvertors/FormConvertor.cpp
+++ b/Sluift/ElementConvertors/FormConvertor.cpp
@@ -27,11 +27,11 @@ namespace {
}
int index = Lua::absoluteOffset(L, -1);
lua_pushnil(L);
for (lua_pushnil(L); lua_next(L, index) != 0; ) {
lua_getfield(L, -1, "name");
- if (lua_equal(L, -1, 2)) {
+ if (lua_compare(L, -1, 2, LUA_OPEQ)) {
lua_pop(L, 1);
return 1;
}
lua_pop(L, 2);
}
@@ -42,11 +42,11 @@ namespace {
lua_getfield(L, 1, "fields");
bool foundField = false;
if (lua_type(L, -1) == LUA_TTABLE) {
for (lua_pushnil(L); lua_next(L, -2) != 0; ) {
lua_getfield(L, -1, "name");
- if (lua_equal(L, -1, 2)) {
+ if (lua_compare(L, -1, 2, LUA_OPEQ)) {
lua_pushvalue(L, 3);
lua_setfield(L, -3, "value");
foundField = true;
lua_pop(L, 3);
break;
diff --git a/Sluift/ElementConvertors/FormConvertor.h b/Sluift/ElementConvertors/FormConvertor.h
index b32a940..8ca20cc 100644
--- a/Sluift/ElementConvertors/FormConvertor.h
+++ b/Sluift/ElementConvertors/FormConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Form.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class FormConvertor : public GenericLuaElementConvertor<Form> {
public:
FormConvertor();
- virtual ~FormConvertor();
+ virtual ~FormConvertor() override;
- virtual std::shared_ptr<Form> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Form>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Form> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Form>) override;
};
}
diff --git a/Sluift/ElementConvertors/ForwardedConvertor.h b/Sluift/ElementConvertors/ForwardedConvertor.h
index a83b5f4..32d29e6 100644
--- a/Sluift/ElementConvertors/ForwardedConvertor.h
+++ b/Sluift/ElementConvertors/ForwardedConvertor.h
@@ -1,31 +1,29 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Forwarded.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class ForwardedConvertor : public GenericLuaElementConvertor<Forwarded> {
public:
ForwardedConvertor(LuaElementConvertors* convertors);
- virtual ~ForwardedConvertor();
+ virtual ~ForwardedConvertor() override;
- virtual std::shared_ptr<Forwarded> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Forwarded>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Forwarded> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Forwarded>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
- private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/IQConvertor.h b/Sluift/ElementConvertors/IQConvertor.h
index 859900a..6ccaa46 100644
--- a/Sluift/ElementConvertors/IQConvertor.h
+++ b/Sluift/ElementConvertors/IQConvertor.h
@@ -1,30 +1,29 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/IQ.h>
#include <Sluift/ElementConvertors/StanzaConvertor.h>
namespace Swift {
class LuaElementConvertors;
class IQConvertor : public StanzaConvertor<IQ> {
public:
IQConvertor(LuaElementConvertors* convertors);
- virtual ~IQConvertor();
+ virtual ~IQConvertor() override;
- virtual std::shared_ptr<IQ> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<IQ>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<IQ> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<IQ>) override;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual boost::optional<Documentation> getDocumentation() const override;
static std::string convertIQTypeToString(IQ::Type type);
static IQ::Type convertIQTypeFromString(const std::string& type);
private:
diff --git a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h
index f8b8c4a..f573b13 100644
--- a/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h
+++ b/Sluift/ElementConvertors/IsodeIQDelegationConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/IsodeIQDelegation.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class IsodeIQDelegationConvertor : public GenericLuaElementConvertor<IsodeIQDelegation> {
public:
IsodeIQDelegationConvertor(LuaElementConvertors* convertors);
- virtual ~IsodeIQDelegationConvertor();
+ virtual ~IsodeIQDelegationConvertor() override;
- virtual std::shared_ptr<IsodeIQDelegation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<IsodeIQDelegation>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<IsodeIQDelegation> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<IsodeIQDelegation>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/MAMFinConvertor.h b/Sluift/ElementConvertors/MAMFinConvertor.h
index 371076a..6e5d58c 100644
--- a/Sluift/ElementConvertors/MAMFinConvertor.h
+++ b/Sluift/ElementConvertors/MAMFinConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/MAMFin.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class MAMFinConvertor : public GenericLuaElementConvertor<MAMFin> {
public:
MAMFinConvertor(LuaElementConvertors* convertors);
- virtual ~MAMFinConvertor();
+ virtual ~MAMFinConvertor() override;
- virtual std::shared_ptr<MAMFin> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMFin>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMFin> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMFin>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/MAMQueryConvertor.h b/Sluift/ElementConvertors/MAMQueryConvertor.h
index 4ee119e..3e9d387 100644
--- a/Sluift/ElementConvertors/MAMQueryConvertor.h
+++ b/Sluift/ElementConvertors/MAMQueryConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/MAMQuery.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class MAMQueryConvertor : public GenericLuaElementConvertor<MAMQuery> {
public:
MAMQueryConvertor(LuaElementConvertors* convertors);
- virtual ~MAMQueryConvertor();
+ virtual ~MAMQueryConvertor() override;
- virtual std::shared_ptr<MAMQuery> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMQuery>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMQuery> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMQuery>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/MAMResultConvertor.h b/Sluift/ElementConvertors/MAMResultConvertor.h
index a1b2564..cd1d27d 100644
--- a/Sluift/ElementConvertors/MAMResultConvertor.h
+++ b/Sluift/ElementConvertors/MAMResultConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/MAMResult.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class MAMResultConvertor : public GenericLuaElementConvertor<MAMResult> {
public:
MAMResultConvertor(LuaElementConvertors* convertors);
- virtual ~MAMResultConvertor();
+ virtual ~MAMResultConvertor() override;
- virtual std::shared_ptr<MAMResult> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMResult>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<MAMResult> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<MAMResult>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/MessageConvertor.h b/Sluift/ElementConvertors/MessageConvertor.h
index 2031552..723e1b1 100644
--- a/Sluift/ElementConvertors/MessageConvertor.h
+++ b/Sluift/ElementConvertors/MessageConvertor.h
@@ -1,30 +1,29 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Message.h>
#include <Sluift/ElementConvertors/StanzaConvertor.h>
namespace Swift {
class LuaElementConvertors;
class MessageConvertor : public StanzaConvertor<Message> {
public:
MessageConvertor(LuaElementConvertors* convertors);
- virtual ~MessageConvertor();
+ virtual ~MessageConvertor() override;
- virtual std::shared_ptr<Message> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Message>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Message> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Message>) override;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual boost::optional<Documentation> getDocumentation() const override;
static std::string convertMessageTypeToString(Message::Type type);
static Message::Type convertMessageTypeFromString(const std::string& type);
private:
diff --git a/Sluift/ElementConvertors/PresenceConvertor.h b/Sluift/ElementConvertors/PresenceConvertor.h
index 11ec547..b13398d 100644
--- a/Sluift/ElementConvertors/PresenceConvertor.h
+++ b/Sluift/ElementConvertors/PresenceConvertor.h
@@ -1,30 +1,29 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Presence.h>
#include <Sluift/ElementConvertors/StanzaConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PresenceConvertor : public StanzaConvertor<Presence> {
public:
PresenceConvertor(LuaElementConvertors* convertors);
- virtual ~PresenceConvertor();
+ virtual ~PresenceConvertor() override;
- virtual std::shared_ptr<Presence> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Presence>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Presence> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Presence>) override;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual boost::optional<Documentation> getDocumentation() const override;
static std::string convertPresenceTypeToString(Presence::Type type);
static Presence::Type convertPresenceTypeFromString(const std::string& type);
private:
diff --git a/Sluift/ElementConvertors/PubSubAffiliationConvertor.h b/Sluift/ElementConvertors/PubSubAffiliationConvertor.h
index 456ef4e..1b5cd60 100644
--- a/Sluift/ElementConvertors/PubSubAffiliationConvertor.h
+++ b/Sluift/ElementConvertors/PubSubAffiliationConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubAffiliation.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubAffiliationConvertor : public GenericLuaElementConvertor<PubSubAffiliation> {
public:
PubSubAffiliationConvertor();
- virtual ~PubSubAffiliationConvertor();
+ virtual ~PubSubAffiliationConvertor() override;
- virtual std::shared_ptr<PubSubAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliation>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubAffiliation> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliation>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp
index c6ba09e..8f8a660 100644
--- a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.cpp
@@ -31,11 +31,11 @@ std::shared_ptr<PubSubAffiliations> PubSubAffiliationsConvertor::doConvertFromLu
result->setNode(std::string(lua_tostring(L, -1)));
}
lua_pop(L, 1);
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubAffiliation> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubAffiliation> payload = std::dynamic_pointer_cast<PubSubAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_affiliation"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h
index 8ad38b2..eda218b 100644
--- a/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubAffiliationsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubAffiliations.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubAffiliationsConvertor : public GenericLuaElementConvertor<PubSubAffiliations> {
public:
PubSubAffiliationsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubAffiliationsConvertor();
+ virtual ~PubSubAffiliationsConvertor() override;
- virtual std::shared_ptr<PubSubAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliations>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubAffiliations> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubAffiliations>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubConfigureConvertor.h b/Sluift/ElementConvertors/PubSubConfigureConvertor.h
index e41bb68..f1848c2 100644
--- a/Sluift/ElementConvertors/PubSubConfigureConvertor.h
+++ b/Sluift/ElementConvertors/PubSubConfigureConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubConfigure.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubConfigureConvertor : public GenericLuaElementConvertor<PubSubConfigure> {
public:
PubSubConfigureConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubConfigureConvertor();
+ virtual ~PubSubConfigureConvertor() override;
- virtual std::shared_ptr<PubSubConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubConfigure>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubConfigure> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubConfigure>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubCreateConvertor.h b/Sluift/ElementConvertors/PubSubCreateConvertor.h
index 12c47da..f3b11bd 100644
--- a/Sluift/ElementConvertors/PubSubCreateConvertor.h
+++ b/Sluift/ElementConvertors/PubSubCreateConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubCreate.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubCreateConvertor : public GenericLuaElementConvertor<PubSubCreate> {
public:
PubSubCreateConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubCreateConvertor();
+ virtual ~PubSubCreateConvertor() override;
- virtual std::shared_ptr<PubSubCreate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubCreate>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubCreate> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubCreate>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubDefaultConvertor.h b/Sluift/ElementConvertors/PubSubDefaultConvertor.h
index fbdbf95..1049cd4 100644
--- a/Sluift/ElementConvertors/PubSubDefaultConvertor.h
+++ b/Sluift/ElementConvertors/PubSubDefaultConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubDefault.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubDefaultConvertor : public GenericLuaElementConvertor<PubSubDefault> {
public:
PubSubDefaultConvertor();
- virtual ~PubSubDefaultConvertor();
+ virtual ~PubSubDefaultConvertor() override;
- virtual std::shared_ptr<PubSubDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubDefault>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubDefault> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubDefault>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h
index 975aa60..e84460f 100644
--- a/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventAssociateConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventAssociate.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventAssociateConvertor : public GenericLuaElementConvertor<PubSubEventAssociate> {
public:
PubSubEventAssociateConvertor();
- virtual ~PubSubEventAssociateConvertor();
+ virtual ~PubSubEventAssociateConvertor() override;
- virtual std::shared_ptr<PubSubEventAssociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventAssociate>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventAssociate> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventAssociate>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h
index e8feada..cab3b97 100644
--- a/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventCollectionConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventCollection.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventCollectionConvertor : public GenericLuaElementConvertor<PubSubEventCollection> {
public:
PubSubEventCollectionConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventCollectionConvertor();
+ virtual ~PubSubEventCollectionConvertor() override;
- virtual std::shared_ptr<PubSubEventCollection> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventCollection>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventCollection> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventCollection>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h
index dd327d4..c2d82a5 100644
--- a/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventConfigurationConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventConfiguration.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventConfigurationConvertor : public GenericLuaElementConvertor<PubSubEventConfiguration> {
public:
PubSubEventConfigurationConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventConfigurationConvertor();
+ virtual ~PubSubEventConfigurationConvertor() override;
- virtual std::shared_ptr<PubSubEventConfiguration> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventConfiguration>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventConfiguration> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventConfiguration>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventConvertor.h b/Sluift/ElementConvertors/PubSubEventConvertor.h
index 8b0cbec..b116c68 100644
--- a/Sluift/ElementConvertors/PubSubEventConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventConvertor.h
@@ -1,28 +1,27 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEvent.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventConvertor : public GenericLuaElementConvertor<PubSubEvent> {
public:
PubSubEventConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventConvertor();
+ virtual ~PubSubEventConvertor() override;
- virtual std::shared_ptr<PubSubEvent> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEvent>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEvent> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEvent>) override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h
index ba2b0b8..66c706f 100644
--- a/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventDeleteConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventDelete.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventDeleteConvertor : public GenericLuaElementConvertor<PubSubEventDelete> {
public:
PubSubEventDeleteConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventDeleteConvertor();
+ virtual ~PubSubEventDeleteConvertor() override;
- virtual std::shared_ptr<PubSubEventDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDelete>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventDelete> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDelete>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h
index 0a1d678..17f9ae9 100644
--- a/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventDisassociateConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventDisassociate.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventDisassociateConvertor : public GenericLuaElementConvertor<PubSubEventDisassociate> {
public:
PubSubEventDisassociateConvertor();
- virtual ~PubSubEventDisassociateConvertor();
+ virtual ~PubSubEventDisassociateConvertor() override;
- virtual std::shared_ptr<PubSubEventDisassociate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDisassociate>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventDisassociate> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventDisassociate>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp b/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp
index ac86024..19ab09a 100644
--- a/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubEventItemConvertor.cpp
@@ -37,11 +37,11 @@ std::shared_ptr<PubSubEventItem> PubSubEventItemConvertor::doConvertFromLua(lua_
}
lua_pop(L, 1);
lua_getfield(L, -1, "data");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<Payload> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubEventItemConvertor.h b/Sluift/ElementConvertors/PubSubEventItemConvertor.h
index 6239b14..9e29ce8 100644
--- a/Sluift/ElementConvertors/PubSubEventItemConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventItemConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventItem.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventItemConvertor : public GenericLuaElementConvertor<PubSubEventItem> {
public:
PubSubEventItemConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventItemConvertor();
+ virtual ~PubSubEventItemConvertor() override;
- virtual std::shared_ptr<PubSubEventItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItem>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventItem> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItem>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp b/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp
index 7a3cde1..66f798e 100644
--- a/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubEventItemsConvertor.cpp
@@ -32,11 +32,11 @@ std::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(lu
}
lua_pop(L, 1);
lua_getfield(L, -1, "items");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubEventItem> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubEventItem> payload = std::dynamic_pointer_cast<PubSubEventItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_item"))) {
items.push_back(payload);
@@ -49,11 +49,11 @@ std::shared_ptr<PubSubEventItems> PubSubEventItemsConvertor::doConvertFromLua(lu
}
lua_pop(L, 1);
lua_getfield(L, -1, "retracts");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubEventRetract> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubEventRetract> payload = std::dynamic_pointer_cast<PubSubEventRetract>(convertors->convertFromLuaUntyped(L, -1, "pubsub_event_retract"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubEventItemsConvertor.h b/Sluift/ElementConvertors/PubSubEventItemsConvertor.h
index ea8942b..8f7e3fe 100644
--- a/Sluift/ElementConvertors/PubSubEventItemsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventItemsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventItems.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventItemsConvertor : public GenericLuaElementConvertor<PubSubEventItems> {
public:
PubSubEventItemsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubEventItemsConvertor();
+ virtual ~PubSubEventItemsConvertor() override;
- virtual std::shared_ptr<PubSubEventItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItems>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventItems> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventItems>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h
index e3321b1..1c2cdbb 100644
--- a/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventPurgeConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventPurge.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventPurgeConvertor : public GenericLuaElementConvertor<PubSubEventPurge> {
public:
PubSubEventPurgeConvertor();
- virtual ~PubSubEventPurgeConvertor();
+ virtual ~PubSubEventPurgeConvertor() override;
- virtual std::shared_ptr<PubSubEventPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventPurge>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventPurge> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventPurge>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h
index b1f33d2..a61cb79 100644
--- a/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventRedirectConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventRedirect.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventRedirectConvertor : public GenericLuaElementConvertor<PubSubEventRedirect> {
public:
PubSubEventRedirectConvertor();
- virtual ~PubSubEventRedirectConvertor();
+ virtual ~PubSubEventRedirectConvertor() override;
- virtual std::shared_ptr<PubSubEventRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRedirect>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventRedirect> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRedirect>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventRetractConvertor.h b/Sluift/ElementConvertors/PubSubEventRetractConvertor.h
index 65aac36..f437ad5 100644
--- a/Sluift/ElementConvertors/PubSubEventRetractConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventRetractConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventRetract.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventRetractConvertor : public GenericLuaElementConvertor<PubSubEventRetract> {
public:
PubSubEventRetractConvertor();
- virtual ~PubSubEventRetractConvertor();
+ virtual ~PubSubEventRetractConvertor() override;
- virtual std::shared_ptr<PubSubEventRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRetract>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventRetract> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventRetract>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h
index 0b3181b..61d1f21 100644
--- a/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h
+++ b/Sluift/ElementConvertors/PubSubEventSubscriptionConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubEventSubscription.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubEventSubscriptionConvertor : public GenericLuaElementConvertor<PubSubEventSubscription> {
public:
PubSubEventSubscriptionConvertor();
- virtual ~PubSubEventSubscriptionConvertor();
+ virtual ~PubSubEventSubscriptionConvertor() override;
- virtual std::shared_ptr<PubSubEventSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventSubscription>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubEventSubscription> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubEventSubscription>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubItemConvertor.cpp b/Sluift/ElementConvertors/PubSubItemConvertor.cpp
index 27fd4a3..b46419a 100644
--- a/Sluift/ElementConvertors/PubSubItemConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubItemConvertor.cpp
@@ -27,11 +27,11 @@ PubSubItemConvertor::~PubSubItemConvertor() {
std::shared_ptr<PubSubItem> PubSubItemConvertor::doConvertFromLua(lua_State* L) {
std::shared_ptr<PubSubItem> result = std::make_shared<PubSubItem>();
lua_getfield(L, -1, "data");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<Payload> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubItemConvertor.h b/Sluift/ElementConvertors/PubSubItemConvertor.h
index 2772932..87c3809 100644
--- a/Sluift/ElementConvertors/PubSubItemConvertor.h
+++ b/Sluift/ElementConvertors/PubSubItemConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubItem.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubItemConvertor : public GenericLuaElementConvertor<PubSubItem> {
public:
PubSubItemConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubItemConvertor();
+ virtual ~PubSubItemConvertor() override;
- virtual std::shared_ptr<PubSubItem> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItem>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubItem> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItem>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubItemsConvertor.cpp b/Sluift/ElementConvertors/PubSubItemsConvertor.cpp
index 5fa1bd3..0bb8eb9 100644
--- a/Sluift/ElementConvertors/PubSubItemsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubItemsConvertor.cpp
@@ -31,11 +31,11 @@ std::shared_ptr<PubSubItems> PubSubItemsConvertor::doConvertFromLua(lua_State* L
result->setNode(std::string(lua_tostring(L, -1)));
}
lua_pop(L, 1);
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubItem> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubItemsConvertor.h b/Sluift/ElementConvertors/PubSubItemsConvertor.h
index 56348b0..9e0f73a 100644
--- a/Sluift/ElementConvertors/PubSubItemsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubItemsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubItems.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubItemsConvertor : public GenericLuaElementConvertor<PubSubItems> {
public:
PubSubItemsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubItemsConvertor();
+ virtual ~PubSubItemsConvertor() override;
- virtual std::shared_ptr<PubSubItems> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItems>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubItems> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubItems>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOptionsConvertor.h b/Sluift/ElementConvertors/PubSubOptionsConvertor.h
index 60d11cc..add661a 100644
--- a/Sluift/ElementConvertors/PubSubOptionsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOptionsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOptions.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOptionsConvertor : public GenericLuaElementConvertor<PubSubOptions> {
public:
PubSubOptionsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOptionsConvertor();
+ virtual ~PubSubOptionsConvertor() override;
- virtual std::shared_ptr<PubSubOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOptions>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOptions> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOptions>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h
index 9020482..92b001b 100644
--- a/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerAffiliation.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerAffiliationConvertor : public GenericLuaElementConvertor<PubSubOwnerAffiliation> {
public:
PubSubOwnerAffiliationConvertor();
- virtual ~PubSubOwnerAffiliationConvertor();
+ virtual ~PubSubOwnerAffiliationConvertor() override;
- virtual std::shared_ptr<PubSubOwnerAffiliation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliation>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerAffiliation> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliation>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp
index ee8a8cb..9ca76fc 100644
--- a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.cpp
@@ -31,11 +31,11 @@ std::shared_ptr<PubSubOwnerAffiliations> PubSubOwnerAffiliationsConvertor::doCon
result->setNode(std::string(lua_tostring(L, -1)));
}
lua_pop(L, 1);
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubOwnerAffiliation> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubOwnerAffiliation> payload = std::dynamic_pointer_cast<PubSubOwnerAffiliation>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_affiliation"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h
index 3026e2c..f0c45a3 100644
--- a/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerAffiliationsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerAffiliations.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerAffiliationsConvertor : public GenericLuaElementConvertor<PubSubOwnerAffiliations> {
public:
PubSubOwnerAffiliationsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOwnerAffiliationsConvertor();
+ virtual ~PubSubOwnerAffiliationsConvertor() override;
- virtual std::shared_ptr<PubSubOwnerAffiliations> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliations>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerAffiliations> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerAffiliations>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h
index 4b39fdf..9f0ed9f 100644
--- a/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerConfigureConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerConfigure.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerConfigureConvertor : public GenericLuaElementConvertor<PubSubOwnerConfigure> {
public:
PubSubOwnerConfigureConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOwnerConfigureConvertor();
+ virtual ~PubSubOwnerConfigureConvertor() override;
- virtual std::shared_ptr<PubSubOwnerConfigure> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerConfigure>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerConfigure> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerConfigure>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h
index ae0f018..ab4a25b 100644
--- a/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerDefaultConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerDefault.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerDefaultConvertor : public GenericLuaElementConvertor<PubSubOwnerDefault> {
public:
PubSubOwnerDefaultConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOwnerDefaultConvertor();
+ virtual ~PubSubOwnerDefaultConvertor() override;
- virtual std::shared_ptr<PubSubOwnerDefault> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDefault>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerDefault> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDefault>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h
index 54a2cf9..8c44b5c 100644
--- a/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerDeleteConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerDelete.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerDeleteConvertor : public GenericLuaElementConvertor<PubSubOwnerDelete> {
public:
PubSubOwnerDeleteConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOwnerDeleteConvertor();
+ virtual ~PubSubOwnerDeleteConvertor() override;
- virtual std::shared_ptr<PubSubOwnerDelete> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDelete>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerDelete> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerDelete>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h
index 4696f45..b2cb565 100644
--- a/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerPurgeConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerPurge.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerPurgeConvertor : public GenericLuaElementConvertor<PubSubOwnerPurge> {
public:
PubSubOwnerPurgeConvertor();
- virtual ~PubSubOwnerPurgeConvertor();
+ virtual ~PubSubOwnerPurgeConvertor() override;
- virtual std::shared_ptr<PubSubOwnerPurge> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerPurge>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerPurge> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerPurge>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h
index 3517a49..433303f 100644
--- a/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerRedirectConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerRedirect.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerRedirectConvertor : public GenericLuaElementConvertor<PubSubOwnerRedirect> {
public:
PubSubOwnerRedirectConvertor();
- virtual ~PubSubOwnerRedirectConvertor();
+ virtual ~PubSubOwnerRedirectConvertor() override;
- virtual std::shared_ptr<PubSubOwnerRedirect> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerRedirect>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerRedirect> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerRedirect>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h
index 2908654..bf054b3 100644
--- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerSubscription.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerSubscriptionConvertor : public GenericLuaElementConvertor<PubSubOwnerSubscription> {
public:
PubSubOwnerSubscriptionConvertor();
- virtual ~PubSubOwnerSubscriptionConvertor();
+ virtual ~PubSubOwnerSubscriptionConvertor() override;
- virtual std::shared_ptr<PubSubOwnerSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscription>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerSubscription> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscription>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp
index 88085b5..3530efe 100644
--- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.cpp
@@ -31,11 +31,11 @@ std::shared_ptr<PubSubOwnerSubscriptions> PubSubOwnerSubscriptionsConvertor::doC
result->setNode(std::string(lua_tostring(L, -1)));
}
lua_pop(L, 1);
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubOwnerSubscription> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubOwnerSubscription> payload = std::dynamic_pointer_cast<PubSubOwnerSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_owner_subscription"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h
index c89b814..2e3f9be 100644
--- a/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubOwnerSubscriptionsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubOwnerSubscriptions.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubOwnerSubscriptionsConvertor : public GenericLuaElementConvertor<PubSubOwnerSubscriptions> {
public:
PubSubOwnerSubscriptionsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubOwnerSubscriptionsConvertor();
+ virtual ~PubSubOwnerSubscriptionsConvertor() override;
- virtual std::shared_ptr<PubSubOwnerSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscriptions>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubOwnerSubscriptions> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubOwnerSubscriptions>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubPublishConvertor.cpp b/Sluift/ElementConvertors/PubSubPublishConvertor.cpp
index 63c97bc..d8a2742 100644
--- a/Sluift/ElementConvertors/PubSubPublishConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubPublishConvertor.cpp
@@ -32,11 +32,11 @@ std::shared_ptr<PubSubPublish> PubSubPublishConvertor::doConvertFromLua(lua_Stat
}
lua_pop(L, 1);
lua_getfield(L, -1, "items");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubItem> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubPublishConvertor.h b/Sluift/ElementConvertors/PubSubPublishConvertor.h
index 1765caf..ae28f14 100644
--- a/Sluift/ElementConvertors/PubSubPublishConvertor.h
+++ b/Sluift/ElementConvertors/PubSubPublishConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubPublish.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubPublishConvertor : public GenericLuaElementConvertor<PubSubPublish> {
public:
PubSubPublishConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubPublishConvertor();
+ virtual ~PubSubPublishConvertor() override;
- virtual std::shared_ptr<PubSubPublish> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubPublish>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubPublish> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubPublish>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
index c070ad6..c27ad7d 100644
--- a/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubRetractConvertor.cpp
@@ -32,11 +32,11 @@ std::shared_ptr<PubSubRetract> PubSubRetractConvertor::doConvertFromLua(lua_Stat
}
lua_pop(L, 1);
lua_getfield(L, -1, "items");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubItem> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubItem> payload = std::dynamic_pointer_cast<PubSubItem>(convertors->convertFromLuaUntyped(L, -1, "pubsub_item"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubRetractConvertor.h b/Sluift/ElementConvertors/PubSubRetractConvertor.h
index 13f7d0d..ca15ca7 100644
--- a/Sluift/ElementConvertors/PubSubRetractConvertor.h
+++ b/Sluift/ElementConvertors/PubSubRetractConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubRetract.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubRetractConvertor : public GenericLuaElementConvertor<PubSubRetract> {
public:
PubSubRetractConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubRetractConvertor();
+ virtual ~PubSubRetractConvertor() override;
- virtual std::shared_ptr<PubSubRetract> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubRetract>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubRetract> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubRetract>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubSubscribeConvertor.h b/Sluift/ElementConvertors/PubSubSubscribeConvertor.h
index 238f677..5f9d224 100644
--- a/Sluift/ElementConvertors/PubSubSubscribeConvertor.h
+++ b/Sluift/ElementConvertors/PubSubSubscribeConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubSubscribe.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubSubscribeConvertor : public GenericLuaElementConvertor<PubSubSubscribe> {
public:
PubSubSubscribeConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubSubscribeConvertor();
+ virtual ~PubSubSubscribeConvertor() override;
- virtual std::shared_ptr<PubSubSubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribe>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscribe> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribe>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h
index fed8779..d853989 100644
--- a/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubSubscribeOptionsConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubSubscribeOptions.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubSubscribeOptionsConvertor : public GenericLuaElementConvertor<PubSubSubscribeOptions> {
public:
PubSubSubscribeOptionsConvertor();
- virtual ~PubSubSubscribeOptionsConvertor();
+ virtual ~PubSubSubscribeOptionsConvertor() override;
- virtual std::shared_ptr<PubSubSubscribeOptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribeOptions>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscribeOptions> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscribeOptions>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h
index 5635181..9cad963 100644
--- a/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h
+++ b/Sluift/ElementConvertors/PubSubSubscriptionConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubSubscription.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubSubscriptionConvertor : public GenericLuaElementConvertor<PubSubSubscription> {
public:
PubSubSubscriptionConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubSubscriptionConvertor();
+ virtual ~PubSubSubscriptionConvertor() override;
- virtual std::shared_ptr<PubSubSubscription> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscription>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscription> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscription>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp
index 3712192..2325181 100644
--- a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp
+++ b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.cpp
@@ -31,11 +31,11 @@ std::shared_ptr<PubSubSubscriptions> PubSubSubscriptionsConvertor::doConvertFrom
result->setNode(std::string(lua_tostring(L, -1)));
}
lua_pop(L, 1);
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::shared_ptr<PubSubSubscription> > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
if (std::shared_ptr<PubSubSubscription> payload = std::dynamic_pointer_cast<PubSubSubscription>(convertors->convertFromLuaUntyped(L, -1, "pubsub_subscription"))) {
items.push_back(payload);
diff --git a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h
index 2c941e6..94b4533 100644
--- a/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h
+++ b/Sluift/ElementConvertors/PubSubSubscriptionsConvertor.h
@@ -1,29 +1,28 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubSubscriptions.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubSubscriptionsConvertor : public GenericLuaElementConvertor<PubSubSubscriptions> {
public:
PubSubSubscriptionsConvertor(LuaElementConvertors* convertors);
- virtual ~PubSubSubscriptionsConvertor();
+ virtual ~PubSubSubscriptionsConvertor() override;
- virtual std::shared_ptr<PubSubSubscriptions> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscriptions>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubSubscriptions> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubSubscriptions>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
private:
LuaElementConvertors* convertors;
};
}
diff --git a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h
index 7270917..f76f2b1 100644
--- a/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h
+++ b/Sluift/ElementConvertors/PubSubUnsubscribeConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/PubSubUnsubscribe.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class PubSubUnsubscribeConvertor : public GenericLuaElementConvertor<PubSubUnsubscribe> {
public:
PubSubUnsubscribeConvertor();
- virtual ~PubSubUnsubscribeConvertor();
+ virtual ~PubSubUnsubscribeConvertor() override;
- virtual std::shared_ptr<PubSubUnsubscribe> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubUnsubscribe>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<PubSubUnsubscribe> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<PubSubUnsubscribe>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/RawXMLElementConvertor.h b/Sluift/ElementConvertors/RawXMLElementConvertor.h
index 79f648f..af3625b 100644
--- a/Sluift/ElementConvertors/RawXMLElementConvertor.h
+++ b/Sluift/ElementConvertors/RawXMLElementConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Serializer/PayloadSerializers/FullPayloadSerializerCollection.h>
#include <Sluift/LuaElementConvertor.h>
namespace Swift {
class RawXMLElementConvertor : public LuaElementConvertor {
public:
RawXMLElementConvertor();
- virtual ~RawXMLElementConvertor();
+ virtual ~RawXMLElementConvertor() override;
- virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) SWIFTEN_OVERRIDE;
- virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Element> convertFromLua(lua_State*, int index, const std::string& type) override;
+ virtual boost::optional<std::string> convertToLua(lua_State*, std::shared_ptr<Element>) override;
private:
FullPayloadSerializerCollection serializers;
};
}
diff --git a/Sluift/ElementConvertors/ResultSetConvertor.h b/Sluift/ElementConvertors/ResultSetConvertor.h
index e1b826c..e098605 100644
--- a/Sluift/ElementConvertors/ResultSetConvertor.h
+++ b/Sluift/ElementConvertors/ResultSetConvertor.h
@@ -1,27 +1,26 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/ResultSet.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class ResultSetConvertor : public GenericLuaElementConvertor<ResultSet> {
public:
ResultSetConvertor();
- virtual ~ResultSetConvertor();
+ virtual ~ResultSetConvertor() override;
- virtual std::shared_ptr<ResultSet> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<ResultSet>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<ResultSet> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<ResultSet>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/SecurityLabelConvertor.cpp b/Sluift/ElementConvertors/SecurityLabelConvertor.cpp
index 21d9a8f..8bc323a 100644
--- a/Sluift/ElementConvertors/SecurityLabelConvertor.cpp
+++ b/Sluift/ElementConvertors/SecurityLabelConvertor.cpp
@@ -24,11 +24,11 @@ SecurityLabelConvertor::~SecurityLabelConvertor() {
std::shared_ptr<SecurityLabel> SecurityLabelConvertor::doConvertFromLua(lua_State* L) {
std::shared_ptr<SecurityLabel> result = std::make_shared<SecurityLabel>();
lua_getfield(L, -1, "equivalent_labels");
if (lua_type(L, -1) == LUA_TTABLE) {
std::vector< std::string > items;
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (lua_isstring(L, -1)) {
items.push_back(std::string(lua_tostring(L, -1)));
}
diff --git a/Sluift/ElementConvertors/SecurityLabelConvertor.h b/Sluift/ElementConvertors/SecurityLabelConvertor.h
index a0e7fea..22d11ca 100644
--- a/Sluift/ElementConvertors/SecurityLabelConvertor.h
+++ b/Sluift/ElementConvertors/SecurityLabelConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2010-2016 Isode Limited.
+ * Copyright (c) 2010-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/SecurityLabel.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class SecurityLabelConvertor : public GenericLuaElementConvertor<SecurityLabel> {
public:
SecurityLabelConvertor();
- virtual ~SecurityLabelConvertor();
+ virtual ~SecurityLabelConvertor() override;
- virtual std::shared_ptr<SecurityLabel> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<SecurityLabel>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<SecurityLabel> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<SecurityLabel>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/SoftwareVersionConvertor.h b/Sluift/ElementConvertors/SoftwareVersionConvertor.h
index 29b1483..791aede 100644
--- a/Sluift/ElementConvertors/SoftwareVersionConvertor.h
+++ b/Sluift/ElementConvertors/SoftwareVersionConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/SoftwareVersion.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class SoftwareVersionConvertor : public GenericLuaElementConvertor<SoftwareVersion> {
public:
SoftwareVersionConvertor();
- virtual ~SoftwareVersionConvertor();
+ virtual ~SoftwareVersionConvertor() override;
- virtual std::shared_ptr<SoftwareVersion> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<SoftwareVersion>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<SoftwareVersion> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<SoftwareVersion>) override;
};
}
diff --git a/Sluift/ElementConvertors/StanzaConvertor.h b/Sluift/ElementConvertors/StanzaConvertor.h
index bdaaad3..a7b4e4e 100644
--- a/Sluift/ElementConvertors/StanzaConvertor.h
+++ b/Sluift/ElementConvertors/StanzaConvertor.h
@@ -44,11 +44,11 @@ namespace Swift {
result->setTo(lua_tostring(L, -1));
}
lua_pop(L, 1);
lua_getfield(L, -1, "payloads");
if (lua_type(L, -1) == LUA_TTABLE) {
- for(size_t i = 0; i < lua_objlen(L, -1); ++i) {
+ for(size_t i = 0; i < lua_rawlen(L, -1); ++i) {
lua_pushnumber(L, i + 1);
lua_gettable(L, -2);
if (!lua_isnil(L, -1)) {
std::shared_ptr<Payload> payload = std::dynamic_pointer_cast<Payload>(convertors->convertFromLua(L, -1));
if (!!payload) {
diff --git a/Sluift/ElementConvertors/StatusConvertor.h b/Sluift/ElementConvertors/StatusConvertor.h
index 53da0ad..994cee5 100644
--- a/Sluift/ElementConvertors/StatusConvertor.h
+++ b/Sluift/ElementConvertors/StatusConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Status.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class StatusConvertor : public GenericLuaElementConvertor<Status> {
public:
StatusConvertor();
- virtual ~StatusConvertor();
+ virtual ~StatusConvertor() override;
- virtual std::shared_ptr<Status> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Status>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Status> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Status>) override;
};
}
diff --git a/Sluift/ElementConvertors/StatusShowConvertor.h b/Sluift/ElementConvertors/StatusShowConvertor.h
index 1521ca3..41be6b3 100644
--- a/Sluift/ElementConvertors/StatusShowConvertor.h
+++ b/Sluift/ElementConvertors/StatusShowConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/StatusShow.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class StatusShowConvertor : public GenericLuaElementConvertor<StatusShow> {
public:
StatusShowConvertor();
- virtual ~StatusShowConvertor();
+ virtual ~StatusShowConvertor() override;
- virtual std::shared_ptr<StatusShow> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<StatusShow>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<StatusShow> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<StatusShow>) override;
static std::string convertStatusShowTypeToString(const StatusShow::Type &show);
static StatusShow::Type convertStatusShowTypeFromString(const std::string& show);
};
}
diff --git a/Sluift/ElementConvertors/SubjectConvertor.h b/Sluift/ElementConvertors/SubjectConvertor.h
index 1520004..f8eb152 100644
--- a/Sluift/ElementConvertors/SubjectConvertor.h
+++ b/Sluift/ElementConvertors/SubjectConvertor.h
@@ -1,25 +1,24 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/Subject.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class SubjectConvertor : public GenericLuaElementConvertor<Subject> {
public:
SubjectConvertor();
- virtual ~SubjectConvertor();
+ virtual ~SubjectConvertor() override;
- virtual std::shared_ptr<Subject> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<Subject>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<Subject> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<Subject>) override;
};
}
diff --git a/Sluift/ElementConvertors/UserLocationConvertor.h b/Sluift/ElementConvertors/UserLocationConvertor.h
index 36e3a0b..b667d2a 100644
--- a/Sluift/ElementConvertors/UserLocationConvertor.h
+++ b/Sluift/ElementConvertors/UserLocationConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/UserLocation.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class UserLocationConvertor : public GenericLuaElementConvertor<UserLocation> {
public:
UserLocationConvertor();
- virtual ~UserLocationConvertor();
+ virtual ~UserLocationConvertor() override;
- virtual std::shared_ptr<UserLocation> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<UserLocation>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<UserLocation> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<UserLocation>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/UserTuneConvertor.h b/Sluift/ElementConvertors/UserTuneConvertor.h
index ba57747..90bda41 100644
--- a/Sluift/ElementConvertors/UserTuneConvertor.h
+++ b/Sluift/ElementConvertors/UserTuneConvertor.h
@@ -1,26 +1,25 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/UserTune.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class LuaElementConvertors;
class UserTuneConvertor : public GenericLuaElementConvertor<UserTune> {
public:
UserTuneConvertor();
- virtual ~UserTuneConvertor();
+ virtual ~UserTuneConvertor() override;
- virtual std::shared_ptr<UserTune> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<UserTune>) SWIFTEN_OVERRIDE;
- virtual boost::optional<Documentation> getDocumentation() const SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<UserTune> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<UserTune>) override;
+ virtual boost::optional<Documentation> getDocumentation() const override;
};
}
diff --git a/Sluift/ElementConvertors/VCardConvertor.h b/Sluift/ElementConvertors/VCardConvertor.h
index d63ef10..1d59c69 100644
--- a/Sluift/ElementConvertors/VCardConvertor.h
+++ b/Sluift/ElementConvertors/VCardConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/VCard.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class VCardConvertor : public GenericLuaElementConvertor<VCard> {
public:
VCardConvertor();
- virtual ~VCardConvertor();
+ virtual ~VCardConvertor() override;
- virtual std::shared_ptr<VCard> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<VCard>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<VCard> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<VCard>) override;
};
}
diff --git a/Sluift/ElementConvertors/VCardUpdateConvertor.h b/Sluift/ElementConvertors/VCardUpdateConvertor.h
index 851f3b1..19e42c6 100644
--- a/Sluift/ElementConvertors/VCardUpdateConvertor.h
+++ b/Sluift/ElementConvertors/VCardUpdateConvertor.h
@@ -1,23 +1,22 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
#include <Swiften/Elements/VCardUpdate.h>
#include <Sluift/GenericLuaElementConvertor.h>
namespace Swift {
class VCardUpdateConvertor : public GenericLuaElementConvertor<VCardUpdate> {
public:
VCardUpdateConvertor();
- virtual ~VCardUpdateConvertor();
+ virtual ~VCardUpdateConvertor() override;
- virtual std::shared_ptr<VCardUpdate> doConvertFromLua(lua_State*) SWIFTEN_OVERRIDE;
- virtual void doConvertToLua(lua_State*, std::shared_ptr<VCardUpdate>) SWIFTEN_OVERRIDE;
+ virtual std::shared_ptr<VCardUpdate> doConvertFromLua(lua_State*) override;
+ virtual void doConvertToLua(lua_State*, std::shared_ptr<VCardUpdate>) override;
};
}
diff --git a/Sluift/Examples/SendReference.lua b/Sluift/Examples/SendReference.lua
new file mode 100644
index 0000000..2e60182
--- /dev/null
+++ b/Sluift/Examples/SendReference.lua
@@ -0,0 +1,74 @@
+#!/usr/bin/env sluift --
+
+-- This is an example of sending a custom payload, a XEP-0372 reference in this
+-- case.
+--
+-- Running this requires a sluift binary somewhere in the PATH. Alternatively,
+-- you can feed this to sluift, or to a Lua that has sluift.so in its library
+-- path.
+
+require("sluift")
+
+DEFAULT_URI = "http://example.com/kitten.jpg"
+
+function usage(err)
+ print("Usage: SendReference.lua jid [tojid] [datauri]")
+ print()
+ print("This tool will log in as jid, and send a reference to tojid. If no tojid")
+ print("is provided, a message to itself is sent. The datauri defaults to")
+ print(DEFAULT_URI .. ", but can be overridden.")
+
+ if err then
+ print("")
+ print("Error: " .. err)
+ end
+ os.exit(1)
+end
+
+function get_password(prompt)
+ if prompt then
+ io.write(prompt)
+ end
+ local stty_ret = os.execute("stty -echo 2>/dev/null")
+ if stty_ret then
+ io.write("\027[8m")
+ end
+ local ok, pass = pcall(io.read, "*l")
+ if stty_ret then
+ io.write("\027[m")
+ else
+ os.execute("stty echo")
+ end
+ io.write("\n");
+ if ok then
+ return pass
+ end
+end
+
+if #arg < 1 then
+ usage("no jid specified")
+end
+jid = arg[1]
+password = os.getenv("XMPP_PASSWORD") or get_password("Password: ")
+tojid = #arg > 1 and arg[2] or jid
+datauri = #arg > 2 and arg[3] or DEFAULT_URI
+
+sluift.debug = 1
+sluift.with(sluift.new_client(jid, password), function()
+ options = { host=os.getenv("XMPP_HOST"), port=os.getenv("XMPP_PORT") }
+ connect(options)
+ reference = {
+ ['_type'] = 'dom',
+ ['tag'] = 'reference',
+ ['ns'] = 'urn:xmpp:reference:0',
+ ['attributes'] = {
+ { ['name'] = 'type', ['value'] = 'data' },
+ { ['name'] = 'uri', ['value'] = datauri },
+ { ['name'] = 'mimeType', ['value'] = arg[4] },
+ { ['name'] = 'begin', ['value'] = arg[5] },
+ { ['name'] = 'end', ['value'] = arg[6] }
+ },
+ }
+ send_message{to=tojid, body="Check out this data!", payloads={reference}}
+ disconnect()
+end)
diff --git a/Sluift/GenericLuaElementConvertor.h b/Sluift/GenericLuaElementConvertor.h
index d94a324..4e52d9e 100644
--- a/Sluift/GenericLuaElementConvertor.h
+++ b/Sluift/GenericLuaElementConvertor.h
@@ -1,19 +1,17 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
#include <string>
#include <lua.hpp>
-#include <Swiften/Base/Override.h>
-
#include <Sluift/Lua/Check.h>
#include <Sluift/Lua/LuaUtils.h>
#include <Sluift/LuaElementConvertor.h>
namespace Swift {
@@ -21,13 +19,13 @@ namespace Swift {
class GenericLuaElementConvertor : public LuaElementConvertor {
public:
GenericLuaElementConvertor(const std::string& type) : type(type) {
}
- virtual ~GenericLuaElementConvertor() {}
+ virtual ~GenericLuaElementConvertor() override {}
- virtual std::shared_ptr<Element> convertFromLua(lua_State* L, int index, const std::string& payloadType) SWIFTEN_OVERRIDE {
+ virtual std::shared_ptr<Element> convertFromLua(lua_State* L, int index, const std::string& payloadType) override {
if (payloadType == type) {
Lua::checkType(L, index, LUA_TTABLE);
lua_pushvalue(L, index);
std::shared_ptr<Element> result = doConvertFromLua(L);
lua_pop(L, 1);
@@ -35,11 +33,11 @@ namespace Swift {
}
return std::shared_ptr<Element>();
}
virtual boost::optional<std::string> convertToLua(
- lua_State* L, std::shared_ptr<Element> payload) SWIFTEN_OVERRIDE {
+ lua_State* L, std::shared_ptr<Element> payload) override {
if (std::shared_ptr<T> actualPayload = std::dynamic_pointer_cast<T>(payload)) {
doConvertToLua(L, actualPayload);
assert(lua_type(L, -1) == LUA_TTABLE);
return type;
}
diff --git a/Sluift/Helpers.h b/Sluift/Helpers.h
index 6af3906..41bfc97 100644
--- a/Sluift/Helpers.h
+++ b/Sluift/Helpers.h
@@ -1,17 +1,16 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
#include <string>
#include <Swiften/Base/API.h>
-#include <Swiften/Base/Override.h>
namespace Swift {
class ClientError;
class ComponentError;
diff --git a/Sluift/Lua/FunctionRegistration.h b/Sluift/Lua/FunctionRegistration.h
index 8e1410d..285c3d0 100644
--- a/Sluift/Lua/FunctionRegistration.h
+++ b/Sluift/Lua/FunctionRegistration.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -9,11 +9,10 @@
#include <string>
#include <lua.hpp>
#include <Swiften/Base/API.h>
-#include <Swiften/Base/Override.h>
#include <Sluift/Lua/FunctionRegistry.h>
namespace Swift {
namespace Lua {
diff --git a/Sluift/Lua/FunctionRegistry.h b/Sluift/Lua/FunctionRegistry.h
index acab3aa..88e15d5 100644
--- a/Sluift/Lua/FunctionRegistry.h
+++ b/Sluift/Lua/FunctionRegistry.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -9,12 +9,10 @@
#include <string>
#include <vector>
#include <lua.hpp>
-#include <Swiften/Base/Override.h>
-
namespace Swift {
namespace Lua {
class FunctionRegistry {
public:
~FunctionRegistry();
diff --git a/Sluift/Lua/LuaUtils.h b/Sluift/Lua/LuaUtils.h
index b87eb38..b9f5bff 100644
--- a/Sluift/Lua/LuaUtils.h
+++ b/Sluift/Lua/LuaUtils.h
@@ -10,11 +10,26 @@
#include <boost/optional.hpp>
#include <string>
#include <vector>
#if LUA_VERSION_NUM < 502
-#define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
+#define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
+#define lua_compare(L,idx1,idx2,LUA_OPEQ) lua_equal(L,(idx1),(idx2))
+#define lua_rawlen(L, i) lua_objlen(L,(i))
+#endif
+#if LUA_VERSION_NUM >= 503
+#undef luaL_register
+#define luaL_register(L, n, l) \
+ lua_getglobal( L, n ); \
+ if( lua_isnil( L, -1 ) ) \
+ { \
+ lua_pop( L, 1 ); \
+ lua_newtable( L ); \
+ } \
+ luaL_setfuncs( L, (l), 0 ); \
+ lua_pushvalue( L, -1 ); \
+ lua_setglobal( L, n );
#endif
namespace Swift {
namespace Lua {
/**
diff --git a/Sluift/LuaElementConvertor.h b/Sluift/LuaElementConvertor.h
index 2cf98e7..eb3a24f 100644
--- a/Sluift/LuaElementConvertor.h
+++ b/Sluift/LuaElementConvertor.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -9,12 +9,10 @@
#include <memory>
#include <string>
#include <boost/optional.hpp>
-#include <Swiften/Base/Override.h>
-
struct lua_State;
namespace Swift {
class Element;
diff --git a/Sluift/LuaElementConvertors.h b/Sluift/LuaElementConvertors.h
index 8e1d10b..bfcffdd 100644
--- a/Sluift/LuaElementConvertors.h
+++ b/Sluift/LuaElementConvertors.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -9,12 +9,10 @@
#include <memory>
#include <vector>
#include <boost/optional.hpp>
-#include <Swiften/Base/Override.h>
-
struct lua_State;
namespace Swift {
class LuaElementConvertor;
class Element;
diff --git a/Sluift/SConscript b/Sluift/SConscript
index de9cab6..af54ece 100644
--- a/Sluift/SConscript
+++ b/Sluift/SConscript
@@ -1,11 +1,11 @@
import Version, os.path
Import(["env"])
if env["SCONS_STAGE"] == "build" and not GetOption("help") and not env.get("HAVE_LUA", 0) :
- print "Warning: Lua was not found. Sluift will not be built."
+ print("Warning: Lua was not found. Sluift will not be built.")
if "Sluift" in env["PROJECTS"] :
env["PROJECTS"].remove("Sluift")
elif env["SCONS_STAGE"] == "build" :
sluift_sources = [
diff --git a/Sluift/SluiftClient.cpp b/Sluift/SluiftClient.cpp
index e8c43c9..99892a9 100644
--- a/Sluift/SluiftClient.cpp
+++ b/Sluift/SluiftClient.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2017 Isode Limited.
+ * Copyright (c) 2013-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Sluift/SluiftClient.h>
@@ -36,20 +36,26 @@ SluiftClient::SluiftClient(
client->onDisconnected.connect(boost::bind(&SluiftClient::handleDisconnected, this, _1));
client->onMessageReceived.connect(boost::bind(&SluiftClient::handleIncomingMessage, this, _1));
client->onPresenceReceived.connect(boost::bind(&SluiftClient::handleIncomingPresence, this, _1));
client->getPubSubManager()->onEvent.connect(boost::bind(&SluiftClient::handleIncomingPubSubEvent, this, _1, _2));
client->getRoster()->onInitialRosterPopulated.connect(boost::bind(&SluiftClient::handleInitialRosterPopulated, this));
+ client->getRoster()->onJIDAdded.connect(boost::bind(&SluiftClient::handleIncomingRosterAdd, this, _1));
+ client->getRoster()->onJIDRemoved.connect(boost::bind(&SluiftClient::handleIncomingRosterRemove, this, _1));
+ client->getRoster()->onJIDUpdated.connect(boost::bind(&SluiftClient::handleIncomingRosterUpdate, this, _1));
client->getClientBlockListManager()->getBlockList()->onItemAdded.connect(boost::bind(&SluiftClient::handleIncomingBlockEvent, this, _1));
client->getClientBlockListManager()->getBlockList()->onItemRemoved.connect(boost::bind(&SluiftClient::handleIncomingUnblockEvent, this, _1));
}
SluiftClient::~SluiftClient() {
delete tracer;
delete client;
}
void SluiftClient::connect() {
+ if (client->isActive()) {
+ throw Lua::Exception("Client is already connecting or connected");
+ }
rosterReceived = false;
blockListReceived = false;
disconnectedError = boost::optional<ClientError>();
client->connect(options);
}
@@ -187,10 +193,22 @@ void SluiftClient::handleIncomingUnblockEvent(const JID& item) {
void SluiftClient::handleInitialRosterPopulated() {
rosterReceived = true;
}
+void SluiftClient::handleIncomingRosterAdd(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterAddType));
+}
+
+void SluiftClient::handleIncomingRosterRemove(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterRemoveType));
+}
+
+void SluiftClient::handleIncomingRosterUpdate(const JID& item) {
+ pendingEvents.push_back(Event(item, Event::RosterUpdateType));
+}
+
void SluiftClient::handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error) {
requestResponse = response;
requestError = error;
requestResponseReceived = true;
}
diff --git a/Sluift/SluiftClient.h b/Sluift/SluiftClient.h
index a48c681..ac4c582 100644
--- a/Sluift/SluiftClient.h
+++ b/Sluift/SluiftClient.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2013-2017 Isode Limited.
+ * Copyright (c) 2013-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -43,11 +43,14 @@ namespace Swift {
enum Type {
MessageType,
PresenceType,
PubSubEventType,
BlockEventType,
- UnblockEventType
+ UnblockEventType,
+ RosterAddType,
+ RosterRemoveType,
+ RosterUpdateType
};
Event(std::shared_ptr<Message> stanza) : type(MessageType), stanza(stanza) {}
Event(std::shared_ptr<Presence> stanza) : type(PresenceType), stanza(stanza) {}
Event(const JID& from, std::shared_ptr<PubSubEventPayload> payload) : type(PubSubEventType), from(from), pubsubEvent(payload) {}
@@ -59,11 +62,11 @@ namespace Swift {
// PubSubEvent
JID from;
std::shared_ptr<PubSubEventPayload> pubsubEvent;
- // Blocklist
+ // Blocklist & Roster Push
JID item;
};
SluiftClient(
const JID& jid,
@@ -79,11 +82,10 @@ namespace Swift {
ClientOptions& getOptions() {
return options;
}
void connect();
- void connect(const std::string& host, int port);
void waitConnected(int timeout);
bool isConnected() const;
void setTraceEnabled(bool b);
template<typename T>
@@ -108,11 +110,11 @@ namespace Swift {
}
void disconnect();
void setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os);
boost::optional<SluiftClient::Event> getNextEvent(int timeout,
- boost::function<bool (const Event&)> condition = 0);
+ boost::function<bool (const Event&)> condition = boost::function<bool (const Event&)>());
std::vector<XMPPRosterItem> getRoster(int timeout);
std::vector<JID> getBlockList(int timeout);
private:
Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout);
@@ -121,10 +123,13 @@ namespace Swift {
void handleIncomingPresence(std::shared_ptr<Presence> stanza);
void handleIncomingPubSubEvent(const JID& from, std::shared_ptr<PubSubEventPayload> event);
void handleIncomingBlockEvent(const JID& item);
void handleIncomingUnblockEvent(const JID& item);
void handleInitialRosterPopulated();
+ void handleIncomingRosterAdd(const JID& item);
+ void handleIncomingRosterRemove(const JID& item);
+ void handleIncomingRosterUpdate(const JID& item);
void handleRequestResponse(std::shared_ptr<Payload> response, std::shared_ptr<ErrorPayload> error);
void handleDisconnected(const boost::optional<ClientError>& error);
private:
NetworkFactories* networkFactories;
diff --git a/Sluift/SluiftComponent.cpp b/Sluift/SluiftComponent.cpp
index e1d1738..74728ee 100644
--- a/Sluift/SluiftComponent.cpp
+++ b/Sluift/SluiftComponent.cpp
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <Sluift/SluiftComponent.h>
@@ -38,11 +38,14 @@ SluiftComponent::SluiftComponent(
SluiftComponent::~SluiftComponent() {
delete tracer;
delete component;
}
-void SluiftComponent::connect(const std::string& host, int port) {
+void SluiftComponent::connect(const std::string& host, unsigned short port) {
+ if (component->isActive()) {
+ throw Lua::Exception("Component is already connecting or connected");
+ }
disconnectedError = boost::optional<ComponentError>();
component->connect(host, port);
}
void SluiftComponent::setTraceEnabled(bool b) {
@@ -73,11 +76,11 @@ bool SluiftComponent::isConnected() const {
return component->isAvailable();
}
void SluiftComponent::disconnect() {
component->disconnect();
- while (component->isAvailable()) {
+ while (component->isActive()) {
eventLoop->runUntilEvents();
}
}
void SluiftComponent::setSoftwareVersion(const std::string& name, const std::string& version, const std::string& /* os */) {
@@ -100,16 +103,16 @@ boost::optional<SluiftComponent::Event> SluiftComponent::getNextEvent(
}
++currentIndex;
}
// Wait for new events
- while (!watchdog.getTimedOut() && currentIndex >= pendingEvents.size() && component->isAvailable()) {
+ while (!watchdog.getTimedOut() && currentIndex >= pendingEvents.size() && component->isActive()) {
eventLoop->runUntilEvents();
}
// Finish if we're disconnected or timed out
- if (watchdog.getTimedOut() || !component->isAvailable()) {
+ if (watchdog.getTimedOut() || !component->isActive()) {
return boost::optional<Event>();
}
}
}
diff --git a/Sluift/SluiftComponent.h b/Sluift/SluiftComponent.h
index d45c3b2..586a94e 100644
--- a/Sluift/SluiftComponent.h
+++ b/Sluift/SluiftComponent.h
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
@@ -61,11 +61,11 @@ namespace Swift {
Component* getComponent() {
return component;
}
- void connect(const std::string& host, int port);
+ void connect(const std::string& host, unsigned short port);
void waitConnected(int timeout);
bool isConnected() const;
void setTraceEnabled(bool b);
template<typename REQUEST_TYPE>
@@ -83,11 +83,11 @@ namespace Swift {
}
void disconnect();
void setSoftwareVersion(const std::string& name, const std::string& version, const std::string& os);
boost::optional<SluiftComponent::Event> getNextEvent(int timeout,
- boost::function<bool (const Event&)> condition = 0);
+ boost::function<bool (const Event&)> condition = boost::function<bool (const Event&)>());
private:
Sluift::Response doSendRequest(std::shared_ptr<Request> request, int timeout);
void handleIncomingMessage(std::shared_ptr<Message> stanza);
diff --git a/Sluift/StandardTerminal.h b/Sluift/StandardTerminal.h
index 2109878..f32bd1c 100644
--- a/Sluift/StandardTerminal.h
+++ b/Sluift/StandardTerminal.h
@@ -1,23 +1,21 @@
/*
- * Copyright (c) 2013-2016 Isode Limited.
+ * Copyright (c) 2013-2017 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#pragma once
-#include <Swiften/Base/Override.h>
-
#include <Sluift/Terminal.h>
namespace Swift {
class StandardTerminal : public Terminal {
public:
StandardTerminal();
- virtual ~StandardTerminal();
+ virtual ~StandardTerminal() override;
- virtual boost::optional<std::string> readLine(const std::string& prompt) SWIFTEN_OVERRIDE;
- virtual void printError(const std::string& message) SWIFTEN_OVERRIDE;
- virtual void addToHistory(const std::string& command) SWIFTEN_OVERRIDE;
+ virtual boost::optional<std::string> readLine(const std::string& prompt) override;
+ virtual void printError(const std::string& message) override;
+ virtual void addToHistory(const std::string& command) override;
};
}
diff --git a/Sluift/client.cpp b/Sluift/client.cpp
index 75f675d..24ece85 100644
--- a/Sluift/client.cpp
+++ b/Sluift/client.cpp
@@ -1,14 +1,12 @@
/*
- * Copyright (c) 2013-2017 Isode Limited.
+ * Copyright (c) 2013-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <boost/assign/list_of.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Disco/ClientDiscoManager.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/Message.h>
@@ -40,11 +38,10 @@
#include <Sluift/Lua/Value.h>
#include <Sluift/SluiftClient.h>
#include <Sluift/globals.h>
using namespace Swift;
-namespace lambda = boost::lambda;
static inline SluiftClient* getClient(lua_State* L) {
return *Lua::checkUserData<SluiftClient>(L, 1);
}
@@ -600,10 +597,37 @@ static void pushEvent(lua_State* L, const SluiftClient::Event& event) {
("jid", std::make_shared<Lua::Value>(event.item.toString()));
Lua::pushValue(L, result);
Lua::registerTableToString(L, -1);
break;
}
+ case SluiftClient::Event::RosterAddType: {
+ Lua::Table result = boost::assign::map_list_of
+ ("type", std::make_shared<Lua::Value>(std::string("rosterpush")))
+ ("jid", std::make_shared<Lua::Value>(event.item.toString()))
+ ("action", std::make_shared<Lua::Value>(std::string("added")));
+ Lua::pushValue(L, result);
+ Lua::registerTableToString(L, -1);
+ break;
+ }
+ case SluiftClient::Event::RosterRemoveType: {
+ Lua::Table result = boost::assign::map_list_of
+ ("type", std::make_shared<Lua::Value>(std::string("rosterpush")))
+ ("jid", std::make_shared<Lua::Value>(event.item.toString()))
+ ("action", std::make_shared<Lua::Value>(std::string("removed")));
+ Lua::pushValue(L, result);
+ Lua::registerTableToString(L, -1);
+ break;
+ }
+ case SluiftClient::Event::RosterUpdateType: {
+ Lua::Table result = boost::assign::map_list_of
+ ("type", std::make_shared<Lua::Value>(std::string("rosterpush")))
+ ("jid", std::make_shared<Lua::Value>(event.item.toString()))
+ ("action", std::make_shared<Lua::Value>(std::string("updated")));
+ Lua::pushValue(L, result);
+ Lua::registerTableToString(L, -1);
+ break;
+ }
}
}
struct CallUnaryLuaPredicateOnEvent {
CallUnaryLuaPredicateOnEvent(lua_State* L, int index) : L(L), index(index) {
@@ -657,11 +681,13 @@ SLUIFT_LUA_FUNCTION(Client, get_next_event) {
if (condition) {
event = client->getNextEvent(timeout, CallUnaryLuaPredicateOnEvent(L, condition));
}
else if (type) {
event = client->getNextEvent(
- timeout, lambda::bind(&SluiftClient::Event::type, lambda::_1) == *type);
+ timeout, [&](const SluiftClient::Event& event) {
+ return event.type == *type;
+ });
}
else {
event = client->getNextEvent(timeout);
}
@@ -699,11 +725,11 @@ SLUIFT_LUA_FUNCTION_WITH_HELP(
item.setName(rawName);
}
lua_getfield(L, 2, "groups");
if (!lua_isnil(L, -1)) {
if (lua_type(L, -1) == LUA_TTABLE) {
- for (size_t i = 1; i <= lua_objlen(L, -1); ++i) {
+ for (size_t i = 1; i <= lua_rawlen(L, -1); ++i) {
lua_rawgeti(L, -1, boost::numeric_cast<int>(i));
const char* rawGroup = lua_tostring(L, -1);
if (rawGroup) {
item.addGroup(rawGroup);
}
diff --git a/Sluift/component.cpp b/Sluift/component.cpp
index df96d43..c1b1da4 100644
--- a/Sluift/component.cpp
+++ b/Sluift/component.cpp
@@ -1,14 +1,12 @@
/*
- * Copyright (c) 2014-2016 Isode Limited.
+ * Copyright (c) 2014-2018 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
#include <boost/assign/list_of.hpp>
-#include <boost/lambda/bind.hpp>
-#include <boost/lambda/lambda.hpp>
#include <Swiften/Base/IDGenerator.h>
#include <Swiften/Elements/DiscoInfo.h>
#include <Swiften/Elements/MAMQuery.h>
#include <Swiften/Elements/Message.h>
@@ -39,11 +37,10 @@
#include <Sluift/Lua/Value.h>
#include <Sluift/SluiftComponent.h>
#include <Sluift/globals.h>
using namespace Swift;
-namespace lambda = boost::lambda;
static inline SluiftComponent* getComponent(lua_State* L) {
return *Lua::checkUserData<SluiftComponent>(L, 1);
}
@@ -97,17 +94,17 @@ static std::vector< std::shared_ptr<Payload> > getPayloadsFromTable(lua_State* L
SLUIFT_LUA_FUNCTION(Component, async_connect) {
SluiftComponent* component = getComponent(L);
std::string host;
- int port = 0;
+ unsigned short port = 0;
if (lua_istable(L, 2)) {
if (boost::optional<std::string> hostString = Lua::getStringField(L, 2, "host")) {
host = *hostString;
}
if (boost::optional<int> portInt = Lua::getIntField(L, 2, "port")) {
- port = *portInt;
+ port = boost::numeric_cast<unsigned short>(*portInt);
}
}
component->connect(host, port);
return 0;
}
@@ -431,11 +428,13 @@ SLUIFT_LUA_FUNCTION(Component, get_next_event) {
if (condition) {
event = component->getNextEvent(timeout, CallUnaryLuaPredicateOnEvent(L, condition));
}
else if (type) {
event = component->getNextEvent(
- timeout, lambda::bind(&SluiftComponent::Event::type, lambda::_1) == *type);
+ timeout, [&](const SluiftComponent::Event& event) {
+ return event.type == *type;
+ });
}
else {
event = component->getNextEvent(timeout);
}
diff --git a/Sluift/core.lua b/Sluift/core.lua
index 89c96ba..f35a603 100644
--- a/Sluift/core.lua
+++ b/Sluift/core.lua
@@ -4,11 +4,12 @@
See the COPYING file for more information.
--]]
local sluift = select(1, ...)
local _G = _G
-local pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack, io = pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, unpack, io
+local pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, io = pairs, ipairs, print, tostring, type, error, assert, next, rawset, xpcall, io
+local unpack = table.unpack or unpack
local setmetatable, getmetatable = setmetatable, getmetatable
local string = require "string"
local table = require "table"
local debug = require "debug"
_ENV = nil
@@ -959,11 +960,11 @@ register_help(Component.process_events)
-- Example usages:
-- component:get_software_version{to = 'alice@wonderland.lit'}
-- component:set_command{to = 'alice@wonderland.lit', command = { type = 'execute', node = 'uptime' }}
--
local get_set_shortcuts = {
- get = {'software_version', 'disco_items', 'xml', 'dom', 'vcard'},
+ get = {'software_version', 'disco_items', 'disco_info', 'xml', 'dom', 'vcard'},
set = {'command', 'vcard'}
}
for query_action, query_types in pairs(get_set_shortcuts) do
for _, query_type in ipairs(query_types) do
_H = {