diff options
Diffstat (limited to 'Swiften/Client/ClientXMLTracer.h')
-rw-r--r-- | Swiften/Client/ClientXMLTracer.h | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/Swiften/Client/ClientXMLTracer.h b/Swiften/Client/ClientXMLTracer.h index bca2a54..0752faa 100644 --- a/Swiften/Client/ClientXMLTracer.h +++ b/Swiften/Client/ClientXMLTracer.h @@ -6,29 +6,20 @@ #pragma once -#include <boost/bind.hpp> - #include <Swiften/Client/CoreClient.h> +#include <Swiften/Client/XMLBeautifier.h> +#include <Swiften/Base/SafeByteArray.h> namespace Swift { class ClientXMLTracer { public: - ClientXMLTracer(CoreClient* client) { - client->onDataRead.connect(boost::bind(&ClientXMLTracer::printData, '<', _1)); - client->onDataWritten.connect(boost::bind(&ClientXMLTracer::printData, '>', _1)); - } - + ClientXMLTracer(CoreClient* client); + ~ClientXMLTracer(); private: - static void printData(char direction, const std::string& data) { - printLine(direction); - std::cerr << data << std::endl; - } + void printData(char direction, const SafeByteArray& data); + void printLine(char c); - static void printLine(char c) { - for (unsigned int i = 0; i < 80; ++i) { - std::cerr << c; - } - std::cerr << std::endl; - } + private: + XMLBeautifier *beautifier; }; } |