-#include "rpcconfig.h"
+#include <ostream> // xmlrpc-c devs have missed something :)
+
#include "tariffs_methods.h"
+#include "rpcconfig.h"
#include "tariff_helper.h"
-#include "../../../tariffs.h"
-#include "../../../users.h"
-#include "../../../admins.h"
-#include "../../../admin.h"
+
+#include "stg/tariffs.h"
+#include "stg/tariff.h"
+#include "stg/tariff_conf.h"
+#include "stg/users.h"
+#include "stg/admins.h"
+#include "stg/admin.h"
void METHOD_TARIFF_GET::execute(xmlrpc_c::paramList const & paramList,
xmlrpc_c::value * const retvalPtr)
return;
}
-const TARIFF * tariff = tariffs->FindByName(name);
+const auto tariff = tariffs->FindByName(name);
if (!tariff)
{
return;
}
-TARIFF_DATA td;
-
-tariff->GetTariffData(&td);
+auto td = tariff->GetTariffData();
TARIFF_HELPER helper(td);
return;
}
-ADMIN admin;
+STG::Admin * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
}
-const TARIFF * tariff = tariffs->FindByName(name);
+const auto tariff = tariffs->FindByName(name);
if (!tariff)
{
return;
}
-TARIFF_DATA td;
-
-tariff->GetTariffData(&td);
+auto td = tariff->GetTariffData();
TARIFF_HELPER helper(td);
std::vector<xmlrpc_c::value> tariffsInfo;
-std::list<TARIFF_DATA> dataList;
+std::vector<STG::TariffData> dataList;
tariffs->GetTariffsData(&dataList);
-std::list<TARIFF_DATA>::const_iterator it = dataList.begin();
+auto it = dataList.begin();
for (; it != dataList.end(); ++it)
{
xmlrpc_c::value info;
- TARIFF_DATA td(*it); // 'cause TARIFF_HELPER work in both ways and take not const referense
+ auto td = *it; // 'cause TARIFF_HELPER work in both ways and take not const referense
TARIFF_HELPER helper(td);
helper.GetTariffInfo(&info);
tariffsInfo.push_back(info);
{
std::string cookie = paramList.getString(0);
std::string tariff = paramList.getString(1);
-std::string enc;
paramList.verifyEnd(2);
ADMIN_INFO adminInfo;
return;
}
-ADMIN admin;
+STG::Admin * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;
return;
}
-ADMIN admin;
+STG::Admin * admin;
-if (admins->FindAdmin(adminInfo.admin, &admin))
+if (admins->find(adminInfo.admin, &admin))
{
*retvalPtr = xmlrpc_c::value_boolean(false);
return;