summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Sluift/ElementConvertors/MAMFinConvertor.cpp
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Sluift/ElementConvertors/MAMFinConvertor.cpp')
-rw-r--r--Sluift/ElementConvertors/MAMFinConvertor.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/Sluift/ElementConvertors/MAMFinConvertor.cpp b/Sluift/ElementConvertors/MAMFinConvertor.cpp
index 977dbc9..1bb6c05 100644
--- a/Sluift/ElementConvertors/MAMFinConvertor.cpp
+++ b/Sluift/ElementConvertors/MAMFinConvertor.cpp
@@ -17,64 +17,64 @@
using namespace Swift;
-MAMFinConvertor::MAMFinConvertor(LuaElementConvertors* convertors) :
- GenericLuaElementConvertor<MAMFin>("mam_fin"),
- convertors(convertors) {
+MAMFinConvertor::MAMFinConvertor(LuaElementConvertors* convertors) :
+ GenericLuaElementConvertor<MAMFin>("mam_fin"),
+ convertors(convertors) {
}
MAMFinConvertor::~MAMFinConvertor() {
}
boost::shared_ptr<MAMFin> MAMFinConvertor::doConvertFromLua(lua_State* L) {
- boost::shared_ptr<MAMFin> result = boost::make_shared<MAMFin>();
- lua_getfield(L, -1, "query_id");
- if (lua_isstring(L, -1)) {
- result->setQueryID(std::string(lua_tostring(L, -1)));
- }
- lua_pop(L, 1);
- lua_getfield(L, -1, "complete");
- if (lua_isboolean(L, -1)) {
- result->setComplete(lua_toboolean(L, -1) != 0);
- }
- lua_pop(L, 1);
- lua_getfield(L, -1, "stable");
- if (!lua_isnil(L, -1)) {
- result->setStable(lua_toboolean(L, -1) != 0);
- }
- lua_pop(L, 1);
- lua_getfield(L, -1, "result_set");
- if (!lua_isnil(L, -1)) {
- boost::shared_ptr<ResultSet> resultSet = boost::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
- if (!!resultSet) {
- result->setResultSet(resultSet);
- }
- }
- lua_pop(L, 1);
- return result;
+ boost::shared_ptr<MAMFin> result = boost::make_shared<MAMFin>();
+ lua_getfield(L, -1, "query_id");
+ if (lua_isstring(L, -1)) {
+ result->setQueryID(std::string(lua_tostring(L, -1)));
+ }
+ lua_pop(L, 1);
+ lua_getfield(L, -1, "complete");
+ if (lua_isboolean(L, -1)) {
+ result->setComplete(lua_toboolean(L, -1) != 0);
+ }
+ lua_pop(L, 1);
+ lua_getfield(L, -1, "stable");
+ if (!lua_isnil(L, -1)) {
+ result->setStable(lua_toboolean(L, -1) != 0);
+ }
+ lua_pop(L, 1);
+ lua_getfield(L, -1, "result_set");
+ if (!lua_isnil(L, -1)) {
+ boost::shared_ptr<ResultSet> resultSet = boost::dynamic_pointer_cast<ResultSet>(convertors->convertFromLuaUntyped(L, -1, "result_set"));
+ if (!!resultSet) {
+ result->setResultSet(resultSet);
+ }
+ }
+ lua_pop(L, 1);
+ return result;
}
void MAMFinConvertor::doConvertToLua(lua_State* L, boost::shared_ptr<MAMFin> payload) {
- lua_createtable(L, 0, 0);
- if (payload->getQueryID()) {
- lua_pushstring(L, (*payload->getQueryID()).c_str());
- lua_setfield(L, -2, "query_id");
- }
- lua_pushboolean(L, payload->isComplete());
- lua_setfield(L, -2, "complete");
- lua_pushboolean(L, payload->isStable());
- lua_setfield(L, -2, "stable");
- if (convertors->convertToLuaUntyped(L, payload->getResultSet()) > 0) {
- lua_setfield(L, -2, "result_set");
- }
+ lua_createtable(L, 0, 0);
+ if (payload->getQueryID()) {
+ lua_pushstring(L, (*payload->getQueryID()).c_str());
+ lua_setfield(L, -2, "query_id");
+ }
+ lua_pushboolean(L, payload->isComplete());
+ lua_setfield(L, -2, "complete");
+ lua_pushboolean(L, payload->isStable());
+ lua_setfield(L, -2, "stable");
+ if (convertors->convertToLuaUntyped(L, payload->getResultSet()) > 0) {
+ lua_setfield(L, -2, "result_set");
+ }
}
boost::optional<LuaElementConvertor::Documentation> MAMFinConvertor::getDocumentation() const {
- return Documentation(
- "MAMFin",
- "This table has the following fields:\n\n"
- "- `query_id`: string (Optional)\n"
- "- `complete`: boolean (Optional)\n"
- "- `stable`: boolean (Optional)\n"
- "- `result_set`: @{ResultSet} (Optional)\n"
- );
+ return Documentation(
+ "MAMFin",
+ "This table has the following fields:\n\n"
+ "- `query_id`: string (Optional)\n"
+ "- `complete`: boolean (Optional)\n"
+ "- `stable`: boolean (Optional)\n"
+ "- `result_set`: @{ResultSet} (Optional)\n"
+ );
}