]> git.stg.codes - stg.git/blobdiff - stglibs/srvconf.lib/parsers/get_users.cpp
Simplified parser interfaces.
[stg.git] / stglibs / srvconf.lib / parsers / get_users.cpp
index cf62f3579c4b531ef95722c6370f0aa02c8dc84e..6c385b0c5babfbb9463e3a0826ca18f91bd957bc 100644 (file)
 
 #include "get_users.h"
 
-#include <cstddef>
-
 #include <strings.h>
 
 using namespace STG;
 
-GET_USERS::PARSER::PARSER()
-    : callback(NULL),
-      data(NULL),
+GET_USERS::PARSER::PARSER(CALLBACK f, void * d)
+    : callback(f),
+      data(d),
+      userParser(&GET_USERS::PARSER::UserCallback, this),
       depth(0),
       parsingAnswer(false)
 {
-    userParser.SetCallback(&GET_USERS::PARSER::UserCallback, this);
 }
 //-----------------------------------------------------------------------------
 int GET_USERS::PARSER::ParseStart(const char * el, const char ** attr)
@@ -69,12 +67,6 @@ void GET_USERS::PARSER::AddUser(const GET_USER::INFO & userInfo)
 info.push_back(userInfo);
 }
 //-----------------------------------------------------------------------------
-void GET_USERS::PARSER::SetCallback(CALLBACK f, void * d)
-{
-callback = f;
-data = d;
-}
-//-----------------------------------------------------------------------------
 void GET_USERS::PARSER::UserCallback(bool result, const std::string & error, const GET_USER::INFO & info, void * data)
 {
     GET_USERS::PARSER * parser = static_cast<GET_USERS::PARSER *>(data);