]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/include/stg/parser_get_users.h
Moved CHECK_USER parser from global scope.
[stg.git] / stglibs / srvconf.lib / include / stg / parser_get_users.h
index b35aa48c486b0ff1e3692c94716f097c66b9908d..a8b8ac855ad6d35335705eb0b363bfc716c80193 100644 (file)
 #ifndef __STG_STGLIBS_SRVCONF_PARSER_GET_USERS_H__
 #define __STG_STGLIBS_SRVCONF_PARSER_GET_USERS_H__
 
-#include "stg/parser.h"
+#include "parser.h"
 
 #include "parser_get_user.h"
 
 #include <vector>
 
+namespace STG
+{
+
 class PARSER_GET_USERS: public PARSER
 {
 public:
     typedef std::vector<PARSER_GET_USER::INFO> INFO;
-    typedef void (* CALLBACK)(const INFO & info, void * data);
+    typedef void (* CALLBACK)(bool result, const std::string & reason, const INFO & info, void * data);
 
     PARSER_GET_USERS();
     int  ParseStart(const char * el, const char ** attr);
@@ -45,11 +48,15 @@ private:
     PARSER_GET_USER userParser;
     INFO info;
     int depth;
+    bool parsingAnswer;
+    std::string error;
 
     void AddUser(const PARSER_GET_USER::INFO & userInfo);
-    void ParseUsers(const char * el, const char ** attr);
+    void SetError(const std::string & e) { error = e; }
 
-    static void UserCallback(const PARSER_GET_USER::INFO & info, void * data);
+    static void UserCallback(bool result, const std::string& reason, const PARSER_GET_USER::INFO & info, void * data);
 };
 
+} // namespace STG
+
 #endif