X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/85b2cf6a5286a94b5e35c7fc6b17bdf941f56420..99090ca5351c98fd9ce9773456a8a3c3936e8c60:/stglibs/srvconf.lib/servconf.cpp diff --git a/stglibs/srvconf.lib/servconf.cpp b/stglibs/srvconf.lib/servconf.cpp index 92773d7f..11e755ba 100644 --- a/stglibs/srvconf.lib/servconf.cpp +++ b/stglibs/srvconf.lib/servconf.cpp @@ -39,6 +39,10 @@ #include "parsers/get_user.h" #include "parsers/chg_user.h" +#include "parsers/get_services.h" +#include "parsers/get_service.h" +#include "parsers/chg_service.h" + #include "parsers/base.h" #include "stg/common.h" @@ -239,6 +243,38 @@ int SERVCONF::CheckUser(const std::string & login, const std::string & password, return pImpl->Exec("CheckUser", "", f, data); } +// -- Services -- + +int SERVCONF::GetServices(GET_SERVICES::CALLBACK f, void * data) +{ +return pImpl->Exec("", f, data); +} + +int SERVCONF::GetService(const std::string & name, GET_SERVICE::CALLBACK f, void * data) +{ +return pImpl->Exec("", f, data); +} + +int SERVCONF::ChgService(const SERVICE_CONF_RES & conf, SIMPLE::CALLBACK f, void * data) +{ +return pImpl->Exec("SetService", "" + CHG_SERVICE::Serialize(conf) + "", f, data); +} + +int SERVCONF::AddService(const std::string & name, + const SERVICE_CONF_RES & conf, + SIMPLE::CALLBACK f, void * data) +{ +int res = pImpl->Exec("AddService", "", f, data); +if (res != st_ok) + return res; +return pImpl->Exec("SetService", "" + CHG_SERVICE::Serialize(conf) + "", f, data); +} + +int SERVCONF::DelService(const std::string & name, SIMPLE::CALLBACK f, void * data) +{ +return pImpl->Exec("DelService", "", f, data); +} + const std::string & SERVCONF::GetStrError() const { return pImpl->GetStrError();