]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/include/stg/parser_get_users.h
Better handling of errors from server. Refactoring.
[stg.git] / stglibs / srvconf.lib / include / stg / parser_get_users.h
index 5338a91357e8978ae4ee3a52e3fd1cec2ff0c012..57907026376133807c04f855663814a5b1ad7b03 100644 (file)
@@ -33,7 +33,7 @@ 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,8 +45,10 @@ private:
     PARSER_GET_USER userParser;
     INFO info;
     int depth;
+    std::string error;
 
     void AddUser(const PARSER_GET_USER::INFO & userInfo);
+    void SetError(const std::string & e) { error = e; }
     void ParseUsers(const char * el, const char ** attr);
 
     static void UserCallback(const PARSER_GET_USER::INFO & info, void * data);