summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Client/XMLBeautifier.h')
-rw-r--r--Swiften/Client/XMLBeautifier.h51
1 files changed, 26 insertions, 25 deletions
diff --git a/Swiften/Client/XMLBeautifier.h b/Swiften/Client/XMLBeautifier.h
index f8dccc5..8da935a 100644
--- a/Swiften/Client/XMLBeautifier.h
+++ b/Swiften/Client/XMLBeautifier.h
@@ -5,7 +5,7 @@
*/
/*
- * Copyright (c) 2014-2015 Isode Limited.
+ * Copyright (c) 2014-2016 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
@@ -13,49 +13,50 @@
#pragma once
#include <sstream>
-#include <string>
#include <stack>
+#include <string>
+
+#include <boost/signals2.hpp>
#include <Swiften/Base/API.h>
-#include <Swiften/Base/boost_bsignals.h>
-#include <Swiften/Parser/XMLParserFactory.h>
-#include <Swiften/Parser/XMLParserClient.h>
#include <Swiften/Parser/XMLParser.h>
+#include <Swiften/Parser/XMLParserClient.h>
+#include <Swiften/Parser/XMLParserFactory.h>
namespace Swift {
class SWIFTEN_API XMLBeautifier : public XMLParserClient {
public:
- XMLBeautifier(bool indention, bool coloring);
- virtual ~XMLBeautifier();
+ XMLBeautifier(bool indention, bool coloring);
+ virtual ~XMLBeautifier();
- std::string beautify(const std::string&);
+ std::string beautify(const std::string&);
private:
- void handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes);
- void handleEndElement(const std::string& element, const std::string& ns);
- void handleCharacterData(const std::string& data);
+ void handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes);
+ void handleEndElement(const std::string& element, const std::string& ns);
+ void handleCharacterData(const std::string& data);
private:
- void indent();
+ void indent();
private:
- std::string styleTag(const std::string& text) const;
- std::string styleNamespace(const std::string& text) const;
- std::string styleAttribute(const std::string& text) const;
- std::string styleValue(const std::string& text) const;
+ std::string styleTag(const std::string& text) const;
+ std::string styleNamespace(const std::string& text) const;
+ std::string styleAttribute(const std::string& text) const;
+ std::string styleValue(const std::string& text) const;
private:
- bool doIndention;
- bool doColoring;
+ bool doIndention;
+ bool doColoring;
- int intLevel;
- std::string inputBuffer;
- std::stringstream buffer;
- XMLParserFactory* factory;
- XMLParser* parser;
+ int intLevel;
+ std::string inputBuffer;
+ std::stringstream buffer;
+ XMLParserFactory* factory;
+ XMLParser* parser;
- bool lastWasStepDown;
- std::stack<std::string> parentNSs;
+ bool lastWasStepDown;
+ std::stack<std::string> parentNSs;
};
}