X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/0ebb52df5d005faab367ad69616958974c5ae107..186fb2b18b89a0280b8cc4b5ea8f7a59d3bd0853:/projects/sgconf/main.cpp diff --git a/projects/sgconf/main.cpp b/projects/sgconf/main.cpp index 625e8564..6a71f652 100644 --- a/projects/sgconf/main.cpp +++ b/projects/sgconf/main.cpp @@ -30,44 +30,16 @@ #include "actions.h" #include "config.h" -#include "stg/servconf.h" -#include "stg/user_conf.h" -#include "stg/user_stat.h" -#include "stg/common.h" - -#include -#include -#include -#include -#include #include -#include +#include -#include -#include -#include -#include +#include // getenv +#include // basename -namespace -{ - -template -struct ARRAY_TYPE -{ -typedef typename T::value_type type; -}; +#include // access -template -struct ARRAY_TYPE -{ -typedef T type; -}; - -template -struct ARRAY_TYPE +namespace { -typedef T type; -}; template struct nullary_function @@ -144,26 +116,6 @@ CONST_METHOD1_ADAPTER Method1Adapt(R (C::* func)(A) const, C & obj) return CONST_METHOD1_ADAPTER(func, obj); } -template -bool SetArrayItem(T & array, const char * index, const typename ARRAY_TYPE::type & value) -{ -size_t pos = 0; -if (str2x(index, pos)) - return false; -array[pos] = value; -return true; -} - -void RawXMLCallback(bool result, const std::string & reason, const std::string & response, void * /*data*/) -{ -if (!result) - { - std::cerr << "Failed to get raw XML response. Reason: '" << reason << "'." << std::endl; - return; - } -SGCONF::PrintXML(response); -} - void Version(const std::string & self) { std::cout << self << ", version: 2.0.0-alpha.\n"; @@ -396,17 +348,6 @@ ACTION * MakeAPIAction(COMMANDS & commands, return new API_ACTION(commands, "", false, funPtr); } -bool RawXMLFunction(const SGCONF::CONFIG & config, - const std::string & arg, - const std::map & /*options*/) -{ - STG::SERVCONF proto(config.server.data(), - config.port.data(), - config.userName.data(), - config.userPass.data()); - return proto.RawXML(arg, RawXMLCallback, NULL) == STG::st_ok; -} - } // namespace SGCONF time_t stgTime;