-class SERVCONF::IMPL
-{
-public:
- IMPL(const std::string & server, uint16_t port,
- const std::string & login, const std::string & password);
- IMPL(const std::string & server, uint16_t port,
- const std::string & localAddress, uint16_t localPort,
- const std::string & login, const std::string & password);
- ~IMPL() { XML_ParserFree(parser); }
-
- const std::string & GetStrError() const;
- static void Start(void * data, const char * el, const char ** attr);
- static void End(void * data, const char * el);
-
- int RawXML(const std::string & request, RAW_XML::CALLBACK f, void * data);
-
- template <class P, typename C>
- int Exec(const std::string & request, C callback, void * data)
- {
- P cp(callback, data, encoding);
- 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, encoding);
- return ExecImpl(request, cp);
- }
-
- const std::string & Encoding() const { return encoding; }
-
-private:
- NETTRANSACT nt;
-
- std::string encoding;
- std::string errorMsg;
- XML_Parser parser;
-
- static bool ParserRecv(const std::string & chunk, bool final, void * data);
- static bool SimpleRecv(const std::string & chunk, bool final, void * data);
- int ExecImpl(const std::string & request, PARSER & cp);
+class ServConf::Impl
+{
+ public:
+ Impl(const std::string& server, uint16_t port,
+ const std::string& login, const std::string& password);
+ Impl(const std::string& server, uint16_t port,
+ const std::string& localAddress, uint16_t localPort,
+ const std::string& login, const std::string& password);
+ ~Impl() { XML_ParserFree(parser); }
+
+ const std::string& GetStrError() const;
+ static void Start(void* data, const char* el, const char** attr);
+ static void End(void* data, const char* el);
+
+ int RawXML(const std::string& request, RawXML::Callback f, void* data);
+
+ template <class P, typename C>
+ int Exec(const std::string& request, C callback, void* data)
+ {
+ return ExecImpl(request, P(callback, data, encoding));
+ }
+
+ template <class P, typename C>
+ int Exec(const std::string& tag, const std::string& request, C callback, void* data)
+ {
+ return ExecImpl(request, P(tag, callback, data, encoding));
+ }
+
+ const std::string& Encoding() const { return encoding; }
+
+ private:
+ NetTransact nt;
+
+ std::string encoding;
+ std::string errorMsg;
+ XML_Parser parser;
+
+ static bool ParserRecv(const std::string& chunk, bool last, void* data);
+ static bool SimpleRecv(const std::string& chunk, bool last, void* data);
+ int ExecImpl(const std::string& request, Parser&& cp);