summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Parser/Tree/ParserElement.cpp')
-rw-r--r--Swiften/Parser/Tree/ParserElement.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/Swiften/Parser/Tree/ParserElement.cpp b/Swiften/Parser/Tree/ParserElement.cpp
index 0baf709..9d9b9b6 100644
--- a/Swiften/Parser/Tree/ParserElement.cpp
+++ b/Swiften/Parser/Tree/ParserElement.cpp
@@ -7,27 +7,21 @@
#include <Swiften/Parser/Tree/ParserElement.h>
#include <Swiften/Parser/Tree/NullParserElement.h>
#include <iostream>
namespace Swift{
ParserElement::ParserElement(const std::string& name, const std::string& xmlns, const AttributeMap& attributes) : name_(name), xmlns_(xmlns), attributes_(attributes) {
-
}
ParserElement::~ParserElement() {
-
-}
-
-ParserElement::operator bool() {
- return true;
}
ParserElement::ref ParserElement::addChild(const std::string& name, const std::string& xmlns, const AttributeMap& attributes) {
ParserElement::ref child = boost::make_shared<ParserElement>(name, xmlns, attributes);
children_.push_back(child);
return child;
}
void ParserElement::appendCharacterData(const std::string& data) {
@@ -46,14 +40,14 @@ struct DoesntMatch {
std::vector<ParserElement::ref> ParserElement::getChildren(const std::string& name, const std::string& xmlns) const {
std::vector<ParserElement::ref> result;
std::remove_copy_if(children_.begin(), children_.end(), std::back_inserter(result), DoesntMatch(name, xmlns));
return result;
}
ParserElement::ref ParserElement::getChild(const std::string& name, const std::string& xmlns) const {
std::vector<ParserElement::ref> results = getChildren(name, xmlns);
- ParserElement::ref result = results.empty() ? boost::make_shared<NullParserElement>() : results[0];
+ ParserElement::ref result = results.empty() ? NullParserElement::element : results[0];
return result;
}
}