+++ /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_CHG_USER_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_CHG_USER_H__
-
-#include "parser.h"
-
-#include <string>
-
-namespace STG
-{
-
-class PARSER_CHG_USER: public PARSER
-{
-public:
- typedef void (* CALLBACK)(bool result, const std::string& reason, void * data);
-
- PARSER_CHG_USER();
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
- void SetCallback(CALLBACK f, void * data);
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // 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>
- */
-
-#ifndef __STG_STGLIBS_SRVCONF_PARSER_SEND_MESSAGE_H__
-#define __STG_STGLIBS_SRVCONF_PARSER_SEND_MESSAGE_H__
-
-#include "parser.h"
-
-#include <string>
-
-namespace STG
-{
-
-class PARSER_SEND_MESSAGE: public PARSER
-{
-public:
- typedef void (* CALLBACK)(bool result, const std::string& reason, void * data);
-
- PARSER_SEND_MESSAGE();
- int ParseStart(const char * el, const char ** attr);
- void ParseEnd(const char * el);
- void SetCallback(CALLBACK f, void * data);
-private:
- CALLBACK callback;
- void * data;
- int depth;
-
- void ParseAnswer(const char * el, const char ** attr);
-};
-
-} // namespace STG
-
-#endif
#ifndef __STG_STGLIBS_SERVCONF_H__
#define __STG_STGLIBS_SERVCONF_H__
-#include "stg/parser_chg_user.h"
-#include "stg/parser_send_message.h"
-
#include "stg/servconf_types.h"
#include "stg/os_int.h"
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, PARSER_CHG_USER::CALLBACK f, void * data);
+ int ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data);
int AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data);
- int SendMessage(const std::string & request, PARSER_SEND_MESSAGE::CALLBACK f, void * data);
+ int SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data);
int ServerInfo(SERVER_INFO::CALLBACK f, void * data);
int CheckUser(const std::string & login, const std::string & password, CHECK_USER::CALLBACK f, void * data);
} // namespace GET_USERS
+namespace CHG_USER
+{
+
+typedef void (* CALLBACK)(bool result, const std::string & reason, void * data);
+
+}
+
+namespace SEND_MESSAGE
+{
+
+typedef void (* CALLBACK)(bool result, const std::string & reason, void * data);
+
+}
+
} // namespace STG
#endif
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
-#include "stg/parser_chg_user.h"
+#include "parser_chg_user.h"
#include <cstddef>
using namespace STG;
-PARSER_CHG_USER::PARSER_CHG_USER()
+CHG_USER::PARSER::PARSER()
: callback(NULL),
data(NULL),
depth(0)
{
}
//-----------------------------------------------------------------------------
-int PARSER_CHG_USER::ParseStart(const char *el, const char **attr)
+int CHG_USER::PARSER::ParseStart(const char *el, const char **attr)
{
depth++;
if (depth == 1)
return 0;
}
//-----------------------------------------------------------------------------
-void PARSER_CHG_USER::ParseEnd(const char *)
+void CHG_USER::PARSER::ParseEnd(const char *)
{
depth--;
}
//-----------------------------------------------------------------------------
-void PARSER_CHG_USER::ParseAnswer(const char * /*el*/, const char ** attr)
+void CHG_USER::PARSER::ParseAnswer(const char * /*el*/, const char ** attr)
{
if (!callback)
return;
callback(false, "Invalid response.", data);
}
//-----------------------------------------------------------------------------
-void PARSER_CHG_USER::SetCallback(CALLBACK f, void * d)
+void CHG_USER::PARSER::SetCallback(CALLBACK f, void * d)
{
callback = f;
data = d;
--- /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_CHG_USER_H__
+#define __STG_STGLIBS_SRVCONF_PARSER_CHG_USER_H__
+
+#include "stg/parser.h"
+#include "stg/servconf_types.h"
+
+namespace STG
+{
+namespace CHG_USER
+{
+
+class PARSER: public STG::PARSER
+{
+public:
+
+ PARSER();
+ int ParseStart(const char * el, const char ** attr);
+ void ParseEnd(const char * el);
+ void SetCallback(CALLBACK f, void * data);
+private:
+ CALLBACK callback;
+ void * data;
+ int depth;
+
+ void ParseAnswer(const char * el, const char ** attr);
+};
+
+} // namespace CHG_USER
+} // namespace STG
+
+#endif
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
-#include "stg/parser_send_message.h"
+#include "parser_send_message.h"
#include <cstddef>
using namespace STG;
-PARSER_SEND_MESSAGE::PARSER_SEND_MESSAGE()
+SEND_MESSAGE::PARSER::PARSER()
: callback(NULL),
data(NULL),
depth(0)
{
}
//-----------------------------------------------------------------------------
-int PARSER_SEND_MESSAGE::ParseStart(const char * el, const char ** attr)
+int SEND_MESSAGE::PARSER::ParseStart(const char * el, const char ** attr)
{
depth++;
if (depth == 1)
return 0;
}
//-----------------------------------------------------------------------------
-void PARSER_SEND_MESSAGE::ParseEnd(const char * /*el*/)
+void SEND_MESSAGE::PARSER::ParseEnd(const char * /*el*/)
{
depth--;
}
//-----------------------------------------------------------------------------
-void PARSER_SEND_MESSAGE::ParseAnswer(const char * /*el*/, const char **attr)
+void SEND_MESSAGE::PARSER::ParseAnswer(const char * /*el*/, const char **attr)
{
if (!callback)
return;
callback(false, "Invalid response.", data);
}
//-----------------------------------------------------------------------------
-void PARSER_SEND_MESSAGE::SetCallback(CALLBACK f, void * d)
+void SEND_MESSAGE::PARSER::SetCallback(CALLBACK f, void * d)
{
callback = f;
data = d;
--- /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 "stg/parser.h"
+#include "stg/servconf_types.h"
+
+#include <string>
+
+namespace STG
+{
+namespace SEND_MESSAGE
+{
+
+class PARSER: public STG::PARSER
+{
+public:
+ PARSER();
+ int ParseStart(const char * el, const char ** attr);
+ void ParseEnd(const char * el);
+ void SetCallback(CALLBACK f, void * data);
+private:
+ CALLBACK callback;
+ void * data;
+ int depth;
+
+ void ParseAnswer(const char * el, const char ** attr);
+};
+
+} // namespace SEND_MESSAGE
+} // namespace STG
+
+#endif
#include "parser_check_user.h"
#include "parser_get_users.h"
#include "parser_get_user.h"
+#include "parser_chg_user.h"
+#include "parser_send_message.h"
#include "stg/common.h"
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, PARSER_CHG_USER::CALLBACK f, void * data);
+ int ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data);
int AuthBy(const std::string & login, AUTH_BY::CALLBACK f, void * data);
- int SendMessage(const std::string & request, PARSER_SEND_MESSAGE::CALLBACK f, void * data);
+ int SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data);
int ServerInfo(SERVER_INFO::CALLBACK f, void * data);
int CheckUser(const std::string & login, const std::string & password, CHECK_USER::CALLBACK f, void * data);
GET_USER::PARSER parserGetUser;
AUTH_BY::PARSER parserAuthBy;
SERVER_INFO::PARSER parserServerInfo;
- PARSER_CHG_USER parserChgUser;
+ CHG_USER::PARSER parserChgUser;
CHECK_USER::PARSER parserCheckUser;
- PARSER_SEND_MESSAGE parserSendMessage;
+ SEND_MESSAGE::PARSER parserSendMessage;
NETTRANSACT nt;
return pImpl->GetUser(login, f, data);
}
-int SERVCONF::ChgUser(const std::string & request, PARSER_CHG_USER::CALLBACK f, void * data)
+int SERVCONF::ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data)
{
return pImpl->ChgUser(request, f, data);
}
return pImpl->AuthBy(login, f, data);
}
-int SERVCONF::SendMessage(const std::string & request, PARSER_SEND_MESSAGE::CALLBACK f, void * data)
+int SERVCONF::SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data)
{
return pImpl->SendMessage(request, f, data);
}
return Exec("<GetServerInfo/>", parserServerInfo);
}
//-----------------------------------------------------------------------------
-int SERVCONF::IMPL::ChgUser(const std::string & request, PARSER_CHG_USER::CALLBACK f, void * data)
+int SERVCONF::IMPL::ChgUser(const std::string & request, CHG_USER::CALLBACK f, void * data)
{
parserChgUser.SetCallback(f, data);
return Exec(request, parserChgUser);
}
//-----------------------------------------------------------------------------
-int SERVCONF::IMPL::SendMessage(const std::string & request, PARSER_SEND_MESSAGE::CALLBACK f, void * data)
+int SERVCONF::IMPL::SendMessage(const std::string & request, SEND_MESSAGE::CALLBACK f, void * data)
{
parserSendMessage.SetCallback(f, data);
return Exec(request, parserSendMessage);