summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
committerTobias Markmann <tm@ayena.de>2016-03-31 14:57:35 (GMT)
commitcfbdb43d2cadd40aa87338d41548e4bf89e146e6 (patch)
tree18d94153a302445196fc0c18586abf44a1ce4a38 /Swiften/Parser/SerializingParser.cpp
parent1d545a4a7fb877f021508094b88c1f17b30d8b4e (diff)
downloadswift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.zip
swift-cfbdb43d2cadd40aa87338d41548e4bf89e146e6.tar.bz2
Convert tabs to 4 spaces for all source files
Removed trailing spaces and whitespace on empty lines in the process. Changed CheckTabs.py tool to disallow hard tabs in source files. Test-Information: Manually checked 30 random files that the conversion worked as expected. Change-Id: I874f99d617bd3d2bb55f02d58f22f58f9b094480
Diffstat (limited to 'Swiften/Parser/SerializingParser.cpp')
-rw-r--r--Swiften/Parser/SerializingParser.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/Swiften/Parser/SerializingParser.cpp b/Swiften/Parser/SerializingParser.cpp
index e939c9f..b58ccd6 100644
--- a/Swiften/Parser/SerializingParser.cpp
+++ b/Swiften/Parser/SerializingParser.cpp
@@ -17,34 +17,34 @@ SerializingParser::SerializingParser() {
}
void SerializingParser::handleStartElement(const std::string& tag, const std::string& ns, const AttributeMap& attributes) {
- boost::shared_ptr<XMLElement> element = boost::make_shared<XMLElement>(tag, ns);
- // FIXME: Ignoring attribute namespace
- foreach (const AttributeMap::Entry& e, attributes.getEntries()) {
- element->setAttribute(e.getAttribute().getName(), e.getValue());
- }
-
- if (elementStack_.empty()) {
- rootElement_ = element;
- }
- else {
- (*(elementStack_.end() - 1))->addNode(element);
- }
- elementStack_.push_back(element);
+ boost::shared_ptr<XMLElement> element = boost::make_shared<XMLElement>(tag, ns);
+ // FIXME: Ignoring attribute namespace
+ foreach (const AttributeMap::Entry& e, attributes.getEntries()) {
+ element->setAttribute(e.getAttribute().getName(), e.getValue());
+ }
+
+ if (elementStack_.empty()) {
+ rootElement_ = element;
+ }
+ else {
+ (*(elementStack_.end() - 1))->addNode(element);
+ }
+ elementStack_.push_back(element);
}
void SerializingParser::handleEndElement(const std::string&, const std::string&) {
- assert(!elementStack_.empty());
- elementStack_.pop_back();
+ assert(!elementStack_.empty());
+ elementStack_.pop_back();
}
void SerializingParser::handleCharacterData(const std::string& data) {
- if (!elementStack_.empty()) {
- (*(elementStack_.end()-1))->addNode(boost::make_shared<XMLTextNode>(data));
- }
+ if (!elementStack_.empty()) {
+ (*(elementStack_.end()-1))->addNode(boost::make_shared<XMLTextNode>(data));
+ }
}
std::string SerializingParser::getResult() const {
- return (rootElement_ ? rootElement_->serialize() : "");
+ return (rootElement_ ? rootElement_->serialize() : "");
}
}