-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(m_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, m_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, m_encoding));
+ }
+
+ const std::string& Encoding() const { return m_encoding; }
+
+ private:
+ NetTransact m_nt;
+
+ std::string m_encoding;
+ std::string m_errorMsg;
+ XML_Parser m_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);