LIBS = -lexpat
SRCS = parsers/property.cpp \
+ parsers/simple.cpp \
parsers/server_info.cpp \
parsers/get_admins.cpp \
parsers/get_admin.cpp \
parsers/chg_admin.cpp \
- parsers/add_admin.cpp \
- parsers/del_admin.cpp \
parsers/auth_by.cpp \
- parsers/check_user.cpp \
parsers/get_user.cpp \
parsers/get_users.cpp \
parsers/chg_user.cpp \
- parsers/send_message.cpp \
netunit.cpp \
servconf.cpp
int GetAdmins(GET_ADMINS::CALLBACK f, void * data);
int GetAdmin(const std::string & login, GET_ADMIN::CALLBACK f, void * data);
- int ChgAdmin(const ADMIN_CONF_RES & conf, CHG_ADMIN::CALLBACK f, void * data);
- int AddAdmin(const std::string & login, const ADMIN_CONF & conf, ADD_ADMIN::CALLBACK f, void * data);
- int DelAdmin(const std::string & login, DEL_ADMIN::CALLBACK f, void * data);
+ int ChgAdmin(const ADMIN_CONF_RES & conf, SIMPLE::CALLBACK f, void * data);
+ int AddAdmin(const std::string & login, const ADMIN_CONF & conf, SIMPLE::CALLBACK f, void * data);
+ int DelAdmin(const std::string & login, SIMPLE::CALLBACK f, void * data);
int GetUsers(GET_USERS::CALLBACK f, void * data);
int GetUser(const std::string & login, GET_USER::CALLBACK f, void * data);
- int ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data);
+ int ChgUser(const std::string & request, SIMPLE::CALLBACK f, void * data);
int AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data);
- int SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data);
- int CheckUser(const std::string & login, const std::string & password, CHECK_USER::CALLBACK f, void * data);
+ int SendMessage(const std::string & request, SIMPLE::CALLBACK f, void * data);
+ int CheckUser(const std::string & login, const std::string & password, SIMPLE::CALLBACK f, void * data);
const std::string & GetStrError() const;
confData
};
-typedef void (* SIMPLE_CALLBACK)(bool result, const std::string & reason, void * data);
+namespace SIMPLE
+{
+
+typedef void (* CALLBACK)(bool result, const std::string & reason, void * data);
+
+} // namespace SIMPLE
namespace AUTH_BY
{
} // namespace SERVER_INFO
-namespace CHECK_USER
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-} // namespace CHECK_USER
-
namespace GET_USER
{
} // namespace GET_USERS
-namespace CHG_USER
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-}
-
-namespace SEND_MESSAGE
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-}
-
namespace GET_ADMIN
{
}
-namespace ADD_ADMIN
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-}
-
-namespace DEL_ADMIN
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-}
-
-namespace CHG_ADMIN
-{
-
-typedef SIMPLE_CALLBACK CALLBACK;
-
-}
-
} // namespace STG
#endif
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#include "add_admin.h"
-
-#include <strings.h>
-
-using namespace STG;
-
-ADD_ADMIN::PARSER::PARSER(CALLBACK f, void * d)
- : callback(f),
- data(d),
- depth(0)
-{
-}
-//-----------------------------------------------------------------------------
-int ADD_ADMIN::PARSER::ParseStart(const char *el, const char **attr)
-{
-depth++;
-if (depth == 1)
- if (strcasecmp(el, "AddAdmin") == 0)
- ParseAnswer(el, attr);
-return 0;
-}
-//-----------------------------------------------------------------------------
-void ADD_ADMIN::PARSER::ParseEnd(const char *)
-{
-depth--;
-}
-//-----------------------------------------------------------------------------
-void ADD_ADMIN::PARSER::ParseAnswer(const char * /*el*/, const char ** attr)
-{
-if (!callback)
- return;
-if (attr && attr[0] && attr[1])
- callback(strcasecmp(attr[1], "ok") == 0, attr[2] && attr[3] ? attr[3] : "", data);
-else
- callback(false, "Invalid response.", data);
-}
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#ifndef __STG_STGLIBS_SRVCONF_PARSER_ADD_ADMIN_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_ADD_ADMIN_H__
-
-#include "base.h"
-
-#include "stg/servconf_types.h"
-
-namespace STG
-{
-namespace ADD_ADMIN
-{
-
-class PARSER: public STG::PARSER
-{
-public:
- PARSER(CALLBACK f, void * data);
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
-
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // namespace ADD_ADMIN
-} // namespace STG
-
-#endif
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#include "check_user.h"
-
-#include <strings.h>
-
-using namespace STG;
-
-CHECK_USER::PARSER::PARSER(CALLBACK f, void * d)
- : callback(f),
- data(d),
- depth(0)
-{
-}
-//-----------------------------------------------------------------------------
-int CHECK_USER::PARSER::ParseStart(const char * el, const char ** attr)
-{
-depth++;
-if (depth == 1)
- if (strcasecmp(el, "CheckUser") == 0)
- ParseAnswer(el, attr);
-return 0;
-}
-//-----------------------------------------------------------------------------
-void CHECK_USER::PARSER::ParseEnd(const char *)
-{
-depth--;
-}
-//-----------------------------------------------------------------------------
-void CHECK_USER::PARSER::ParseAnswer(const char *, const char **attr)
-{
-if (!callback)
- return;
-if (attr && attr[0] && attr[1] && strcasecmp(attr[0], "value") == 0)
- callback(strcasecmp(attr[1], "ok") == 0, attr[2] && attr[3] ? attr[3] : "", data);
-else
- callback(false, "Invalid response.", data);
-}
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#ifndef __STG_STGLIBS_SRVCONF_PARSER_CHECK_USER_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_CHECK_USER_H__
-
-#include "base.h"
-
-#include "stg/servconf_types.h"
-
-namespace STG
-{
-namespace CHECK_USER
-{
-
-class PARSER: public STG::PARSER
-{
-public:
- PARSER(CALLBACK f, void * data);
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
-
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // namespace CHECK_USER
-} // namespace STG
-
-#endif
using namespace STG;
-CHG_ADMIN::PARSER::PARSER(CALLBACK f, void * d)
+CHG_ADMIN::PARSER::PARSER(SIMPLE::CALLBACK f, void * d)
: callback(f),
data(d),
depth(0)
if (!callback)
return;
if (attr && attr[0] && attr[1])
- callback(strcasecmp(attr[1], "ok") == 0, attr[2] && attr[3] ? attr[3] : "", data);
+ callback(strcasecmp(attr[1], "ok") == 0, attr[1], data);
else
callback(false, "Invalid response.", data);
}
class PARSER: public STG::PARSER
{
public:
- PARSER(CALLBACK f, void * data);
+ PARSER(SIMPLE::CALLBACK f, void * data);
int ParseStart(const char * el, const char ** attr);
void ParseEnd(const char * el);
private:
- CALLBACK callback;
+ SIMPLE::CALLBACK callback;
void * data;
int depth;
using namespace STG;
-CHG_USER::PARSER::PARSER(CALLBACK f, void * d)
+CHG_USER::PARSER::PARSER(SIMPLE::CALLBACK f, void * d)
: callback(f),
data(d),
depth(0)
class PARSER: public STG::PARSER
{
public:
- PARSER(CALLBACK f, void * data);
+ PARSER(SIMPLE::CALLBACK f, void * data);
int ParseStart(const char * el, const char ** attr);
void ParseEnd(const char * el);
private:
- CALLBACK callback;
+ SIMPLE::CALLBACK callback;
void * data;
int depth;
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#include "del_admin.h"
-
-#include <strings.h>
-
-using namespace STG;
-
-DEL_ADMIN::PARSER::PARSER(CALLBACK f, void * d)
- : callback(f),
- data(d),
- depth(0)
-{
-}
-//-----------------------------------------------------------------------------
-int DEL_ADMIN::PARSER::ParseStart(const char *el, const char **attr)
-{
-depth++;
-if (depth == 1)
- if (strcasecmp(el, "DelAdmin") == 0)
- ParseAnswer(el, attr);
-return 0;
-}
-//-----------------------------------------------------------------------------
-void DEL_ADMIN::PARSER::ParseEnd(const char *)
-{
-depth--;
-}
-//-----------------------------------------------------------------------------
-void DEL_ADMIN::PARSER::ParseAnswer(const char * /*el*/, const char ** attr)
-{
-if (!callback)
- return;
-if (attr && attr[0] && attr[1])
- callback(strcasecmp(attr[1], "ok") == 0, attr[2] && attr[3] ? attr[3] : "", data);
-else
- callback(false, "Invalid response.", data);
-}
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#ifndef __STG_STGLIBS_SRVCONF_PARSER_DEL_ADMIN_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_DEL_ADMIN_H__
-
-#include "base.h"
-
-#include "stg/servconf_types.h"
-
-namespace STG
-{
-namespace DEL_ADMIN
-{
-
-class PARSER: public STG::PARSER
-{
-public:
- PARSER(CALLBACK f, void * data);
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
-
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // namespace DEL_ADMIN
-} // namespace STG
-
-#endif
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#include "send_message.h"
-
-#include <strings.h>
-
-using namespace STG;
-
-SEND_MESSAGE::PARSER::PARSER(CALLBACK f, void * d)
- : callback(f),
- data(d),
- depth(0)
-{
-}
-//-----------------------------------------------------------------------------
-int SEND_MESSAGE::PARSER::ParseStart(const char * el, const char ** attr)
-{
-depth++;
-if (depth == 1)
- if (strcasecmp(el, "SendMessageResult") == 0)
- ParseAnswer(el, attr);
-return 0;
-}
-//-----------------------------------------------------------------------------
-void SEND_MESSAGE::PARSER::ParseEnd(const char * /*el*/)
-{
-depth--;
-}
-//-----------------------------------------------------------------------------
-void SEND_MESSAGE::PARSER::ParseAnswer(const char * /*el*/, const char **attr)
-{
-if (!callback)
- return;
-if (attr && attr[0] && attr[1])
- callback(strcasecmp(attr[1], "ok") == 0, attr[1], data);
-else
- callback(false, "Invalid response.", data);
-}
+++ /dev/null
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
- * Author : Boris Mikhailenko <stg34@stargazer.dp.ua>
- * Author : Maxim Mamontov <faust@stargazer.dp.ua>
- */
-
-#ifndef __STG_STGLIBS_SRVCONF_PARSER_SEND_MESSAGE_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_SEND_MESSAGE_H__
-
-#include "base.h"
-
-#include "stg/servconf_types.h"
-
-namespace STG
-{
-namespace SEND_MESSAGE
-{
-
-class PARSER: public STG::PARSER
-{
-public:
- PARSER(CALLBACK f, void * data);
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
-
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // namespace SEND_MESSAGE
-} // namespace STG
-
-#endif
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Author : Maxim Mamontov <faust@stargazer.dp.ua>
+ */
+
+#include "simple.h"
+
+#include <strings.h>
+
+using namespace STG;
+
+SIMPLE::PARSER::PARSER(const std::string & t, CALLBACK f, void * d)
+ : tag(t),
+ callback(f),
+ data(d),
+ depth(0)
+{
+}
+//-----------------------------------------------------------------------------
+int SIMPLE::PARSER::ParseStart(const char *el, const char **attr)
+{
+depth++;
+if (depth == 1)
+ if (strcasecmp(el, tag.c_str()) == 0)
+ ParseAnswer(el, attr);
+return 0;
+}
+//-----------------------------------------------------------------------------
+void SIMPLE::PARSER::ParseEnd(const char *)
+{
+depth--;
+}
+//-----------------------------------------------------------------------------
+void SIMPLE::PARSER::ParseAnswer(const char * /*el*/, const char ** attr)
+{
+if (!callback)
+ return;
+if (attr && attr[0] && attr[1])
+ callback(strcasecmp(attr[1], "ok") == 0, attr[2] && attr[3] ? attr[3] : attr[1], data);
+else
+ callback(false, "Invalid response.", data);
+}
--- /dev/null
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+ * Author : Maxim Mamontov <faust@stargazer.dp.ua>
+ */
+
+#ifndef __STG_STGLIBS_SRVCONF_PARSER_SIMPLE_H__
+#define __STG_STGLIBS_SRVCONF_PARSER_SIMPLE_H__
+
+#include "base.h"
+
+#include "stg/servconf_types.h"
+
+#include <string>
+
+namespace STG
+{
+namespace SIMPLE
+{
+
+class PARSER: public STG::PARSER
+{
+public:
+ PARSER(const std::string & tag, CALLBACK f, void * data);
+ int ParseStart(const char * el, const char ** attr);
+ void ParseEnd(const char * el);
+
+private:
+ std::string tag;
+ CALLBACK callback;
+ void * data;
+ int depth;
+
+ void ParseAnswer(const char * el, const char ** attr);
+};
+
+} // namespace SIMPLE
+} // namespace STG
+
+#endif
#include "netunit.h"
+#include "parsers/simple.h"
+
#include "parsers/server_info.h"
#include "parsers/get_admins.h"
#include "parsers/get_admin.h"
#include "parsers/chg_admin.h"
-#include "parsers/add_admin.h"
-#include "parsers/del_admin.h"
#include "parsers/auth_by.h"
-#include "parsers/check_user.h"
#include "parsers/get_users.h"
#include "parsers/get_user.h"
#include "parsers/chg_user.h"
-#include "parsers/send_message.h"
#include "parsers/base.h"
return ExecImpl(request, cp);
}
+ template <class P, typename C>
+ int Exec(const std::string & tag, const std::string & request, C callback, void * data)
+ {
+ P cp(tag, callback, data);
+ return ExecImpl(request, cp);
+ }
+
private:
NETTRANSACT nt;
return pImpl->Exec<GET_ADMIN::PARSER>("<GetAdmin login=\"" + login + "\"/>", f, data);
}
-int SERVCONF::ChgAdmin(const ADMIN_CONF_RES & conf, CHG_ADMIN::CALLBACK f, void * data)
+int SERVCONF::ChgAdmin(const ADMIN_CONF_RES & conf, SIMPLE::CALLBACK f, void * data)
{
return pImpl->Exec<CHG_ADMIN::PARSER>("<ChgAdmin" + CHG_ADMIN::Serialize(conf) + "/>", f, data);
}
-int SERVCONF::AddAdmin(const std::string & login, const ADMIN_CONF & conf, ADD_ADMIN::CALLBACK f, void * data)
+int SERVCONF::AddAdmin(const std::string & login, const ADMIN_CONF & conf, SIMPLE::CALLBACK f, void * data)
{
-int res = pImpl->Exec<ADD_ADMIN::PARSER>("<AddAdmin login=\"" + login + "\"/>", f, data);
+int res = pImpl->Exec<SIMPLE::PARSER>("AddAdmin", "<AddAdmin login=\"" + login + "\"/>", f, data);
if (res != st_ok)
return res;
return pImpl->Exec<CHG_ADMIN::PARSER>("<ChgAdmin" + CHG_ADMIN::Serialize(conf) + "/>", f, data);
}
-int SERVCONF::DelAdmin(const std::string & login, DEL_ADMIN::CALLBACK f, void * data)
+int SERVCONF::DelAdmin(const std::string & login, SIMPLE::CALLBACK f, void * data)
{
-return pImpl->Exec<DEL_ADMIN::PARSER>("<DelAdmin login=\"" + login + "\"/>", f, data);
+return pImpl->Exec<SIMPLE::PARSER>("DelAdmin", "<DelAdmin login=\"" + login + "\"/>", f, data);
}
// -- Users --
return pImpl->Exec<GET_USER::PARSER>("<GetUser login=\"" + login + "\"/>", f, data);
}
-int SERVCONF::ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data)
+int SERVCONF::ChgUser(const std::string & request, SIMPLE::CALLBACK f, void * data)
{
return pImpl->Exec<CHG_USER::PARSER>(request, f, data);
}
return pImpl->Exec<AUTH_BY::PARSER>("<GetUserAuthBy login=\"" + login + "\"/>", f, data);
}
-int SERVCONF::SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data)
+int SERVCONF::SendMessage(const std::string & request, SIMPLE::CALLBACK f, void * data)
{
-return pImpl->Exec<SEND_MESSAGE::PARSER>(request, f, data);
+return pImpl->Exec<SIMPLE::PARSER>("SendMessage", request, f, data);
}
-int SERVCONF::CheckUser(const std::string & login, const std::string & password, CHECK_USER::CALLBACK f, void * data)
+int SERVCONF::CheckUser(const std::string & login, const std::string & password, SIMPLE::CALLBACK f, void * data)
{
-return pImpl->Exec<CHECK_USER::PARSER>("<CheckUser login=\"" + login + "\" password=\"" + password + "\"/>", f, data);
+return pImpl->Exec<SIMPLE::PARSER>("CheckUser", "<CheckUser login=\"" + login + "\" password=\"" + password + "\"/>", f, data);
}
const std::string & SERVCONF::GetStrError() const