diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 18:57:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 21:36:32 (GMT) |
commit | cb05f5a908e20006c954ce38755c2e422ecc2388 (patch) | |
tree | a793551a5fe279a57d4330119560e8542f745484 /Swiften/Parser/PayloadParsers | |
parent | cad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff) | |
download | swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.zip swift-contrib-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2 |
Removed Swift::String.
Diffstat (limited to 'Swiften/Parser/PayloadParsers')
86 files changed, 364 insertions, 364 deletions
diff --git a/Swiften/Parser/PayloadParsers/BodyParser.cpp b/Swiften/Parser/PayloadParsers/BodyParser.cpp index 3f76101..d0f4e09 100644 --- a/Swiften/Parser/PayloadParsers/BodyParser.cpp +++ b/Swiften/Parser/PayloadParsers/BodyParser.cpp @@ -11,18 +11,18 @@ namespace Swift { BodyParser::BodyParser() : level_(0) { } -void BodyParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void BodyParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void BodyParser::handleEndElement(const String&, const String&) { +void BodyParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 0) { getPayloadInternal()->setText(text_); } } -void BodyParser::handleCharacterData(const String& data) { +void BodyParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/BodyParser.h b/Swiften/Parser/PayloadParsers/BodyParser.h index 4318614..f9e17e0 100644 --- a/Swiften/Parser/PayloadParsers/BodyParser.h +++ b/Swiften/Parser/PayloadParsers/BodyParser.h @@ -15,13 +15,13 @@ namespace Swift { public: BodyParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp b/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp index 154a925..35db9ec 100644 --- a/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp +++ b/Swiften/Parser/PayloadParsers/BytestreamsParser.cpp @@ -18,7 +18,7 @@ BytestreamsParser::BytestreamsParser() : level(TopLevel) { BytestreamsParser::~BytestreamsParser() { } -void BytestreamsParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void BytestreamsParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level == TopLevel) { getPayloadInternal()->setStreamID(attributes.getAttribute("sid")); } @@ -37,11 +37,11 @@ void BytestreamsParser::handleStartElement(const String& element, const String&, ++level; } -void BytestreamsParser::handleEndElement(const String&, const String&) { +void BytestreamsParser::handleEndElement(const std::string&, const std::string&) { --level; } -void BytestreamsParser::handleCharacterData(const String&) { +void BytestreamsParser::handleCharacterData(const std::string&) { } diff --git a/Swiften/Parser/PayloadParsers/BytestreamsParser.h b/Swiften/Parser/PayloadParsers/BytestreamsParser.h index a45baa4..2d67785 100644 --- a/Swiften/Parser/PayloadParsers/BytestreamsParser.h +++ b/Swiften/Parser/PayloadParsers/BytestreamsParser.h @@ -17,9 +17,9 @@ namespace Swift { BytestreamsParser(); ~BytestreamsParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { diff --git a/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp b/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp index 6ccccd4..d7d9324 100644 --- a/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp +++ b/Swiften/Parser/PayloadParsers/CapsInfoParser.cpp @@ -13,7 +13,7 @@ namespace Swift { CapsInfoParser::CapsInfoParser() : level(0) { } -void CapsInfoParser::handleStartElement(const String&, const String& /*ns*/, const AttributeMap& attributes) { +void CapsInfoParser::handleStartElement(const std::string&, const std::string& /*ns*/, const AttributeMap& attributes) { if (level == 0) { getPayloadInternal()->setHash(attributes.getAttribute("hash")); getPayloadInternal()->setNode(attributes.getAttribute("node")); @@ -22,11 +22,11 @@ void CapsInfoParser::handleStartElement(const String&, const String& /*ns*/, con ++level; } -void CapsInfoParser::handleEndElement(const String&, const String&) { +void CapsInfoParser::handleEndElement(const std::string&, const std::string&) { --level; } -void CapsInfoParser::handleCharacterData(const String&) { +void CapsInfoParser::handleCharacterData(const std::string&) { } diff --git a/Swiften/Parser/PayloadParsers/CapsInfoParser.h b/Swiften/Parser/PayloadParsers/CapsInfoParser.h index 6058837..590326d 100644 --- a/Swiften/Parser/PayloadParsers/CapsInfoParser.h +++ b/Swiften/Parser/PayloadParsers/CapsInfoParser.h @@ -14,9 +14,9 @@ namespace Swift { public: CapsInfoParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level; diff --git a/Swiften/Parser/PayloadParsers/ChatStateParser.cpp b/Swiften/Parser/PayloadParsers/ChatStateParser.cpp index db205dd..3a5ba3b 100644 --- a/Swiften/Parser/PayloadParsers/ChatStateParser.cpp +++ b/Swiften/Parser/PayloadParsers/ChatStateParser.cpp @@ -11,7 +11,7 @@ namespace Swift { ChatStateParser::ChatStateParser() : level_(0) { } -void ChatStateParser::handleStartElement(const String& element, const String&, const AttributeMap&) { +void ChatStateParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap&) { if (level_ == 0) { ChatState::ChatStateType state = ChatState::Active; if (element == "active") { @@ -30,11 +30,11 @@ void ChatStateParser::handleStartElement(const String& element, const String&, c ++level_; } -void ChatStateParser::handleEndElement(const String&, const String&) { +void ChatStateParser::handleEndElement(const std::string&, const std::string&) { --level_; } -void ChatStateParser::handleCharacterData(const String&) { +void ChatStateParser::handleCharacterData(const std::string&) { } diff --git a/Swiften/Parser/PayloadParsers/ChatStateParser.h b/Swiften/Parser/PayloadParsers/ChatStateParser.h index 2ae4e43..8d0e7f5 100644 --- a/Swiften/Parser/PayloadParsers/ChatStateParser.h +++ b/Swiften/Parser/PayloadParsers/ChatStateParser.h @@ -14,9 +14,9 @@ namespace Swift { public: ChatStateParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; diff --git a/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h b/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h index 27d3c51..3dadda7 100644 --- a/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h +++ b/Swiften/Parser/PayloadParsers/ChatStateParserFactory.h @@ -17,7 +17,7 @@ namespace Swift { ChatStateParserFactory() { } - virtual bool canParse(const String& element, const String& ns, const AttributeMap&) const { + virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap&) const { return ns == "http://jabber.org/protocol/chatstates" && (element == "active" || element == "composing" || element == "paused" || element == "inactive" || element == "gone"); diff --git a/Swiften/Parser/PayloadParsers/CommandParser.cpp b/Swiften/Parser/PayloadParsers/CommandParser.cpp index 76e4564..9422170 100644 --- a/Swiften/Parser/PayloadParsers/CommandParser.cpp +++ b/Swiften/Parser/PayloadParsers/CommandParser.cpp @@ -18,7 +18,7 @@ CommandParser::~CommandParser() { delete formParserFactory_; } -void CommandParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void CommandParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { ++level_; if (level_ == PayloadLevel) { boost::optional<Command::Action> action = parseAction(attributes.getAttribute("action")); @@ -26,7 +26,7 @@ void CommandParser::handleStartElement(const String& element, const String& ns, getPayloadInternal()->setAction(*action); } - String status = attributes.getAttribute("status"); + std::string status = attributes.getAttribute("status"); if (status == "executing") { getPayloadInternal()->setStatus(Command::Executing); } @@ -49,7 +49,7 @@ void CommandParser::handleStartElement(const String& element, const String& ns, else if (element == "note") { inNote_ = true; currentText_.clear(); - String noteType = attributes.getAttribute("type"); + std::string noteType = attributes.getAttribute("type"); if (noteType == "info") { noteType_ = Command::Note::Info; } @@ -79,7 +79,7 @@ void CommandParser::handleStartElement(const String& element, const String& ns, } } -void CommandParser::handleEndElement(const String& element, const String& ns) { +void CommandParser::handleEndElement(const std::string& element, const std::string& ns) { if (formParser_) { formParser_->handleEndElement(element, ns); } @@ -109,7 +109,7 @@ void CommandParser::handleEndElement(const String& element, const String& ns) { --level_; } -void CommandParser::handleCharacterData(const String& data) { +void CommandParser::handleCharacterData(const std::string& data) { if (formParser_) { formParser_->handleCharacterData(data); } @@ -118,7 +118,7 @@ void CommandParser::handleCharacterData(const String& data) { } } -boost::optional<Command::Action> CommandParser::parseAction(const String& action) { +boost::optional<Command::Action> CommandParser::parseAction(const std::string& action) { if (action == "execute") { return Command::Execute; } diff --git a/Swiften/Parser/PayloadParsers/CommandParser.h b/Swiften/Parser/PayloadParsers/CommandParser.h index a682a80..0415ba6 100644 --- a/Swiften/Parser/PayloadParsers/CommandParser.h +++ b/Swiften/Parser/PayloadParsers/CommandParser.h @@ -20,12 +20,12 @@ namespace Swift { CommandParser(); ~CommandParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: - static boost::optional<Command::Action> parseAction(const String& action); + static boost::optional<Command::Action> parseAction(const std::string& action); private: enum Level { @@ -40,6 +40,6 @@ namespace Swift { Command::Note::Type noteType_; FormParserFactory* formParserFactory_; FormParser* formParser_; - String currentText_; + std::string currentText_; }; } diff --git a/Swiften/Parser/PayloadParsers/CommandParserFactory.h b/Swiften/Parser/PayloadParsers/CommandParserFactory.h index da2f484..9eaaf62 100644 --- a/Swiften/Parser/PayloadParsers/CommandParserFactory.h +++ b/Swiften/Parser/PayloadParsers/CommandParserFactory.h @@ -17,7 +17,7 @@ namespace Swift { CommandParserFactory() { } - virtual bool canParse(const String& element, const String& ns, const AttributeMap&) const { + virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap&) const { return ns == "http://jabber.org/protocol/commands" && element == "command"; } diff --git a/Swiften/Parser/PayloadParsers/DelayParser.cpp b/Swiften/Parser/PayloadParsers/DelayParser.cpp index 8e8abff..3425b84 100644 --- a/Swiften/Parser/PayloadParsers/DelayParser.cpp +++ b/Swiften/Parser/PayloadParsers/DelayParser.cpp @@ -15,31 +15,31 @@ namespace Swift { DelayParser::DelayParser(const std::locale& locale) : locale(locale), level_(0) { } -boost::posix_time::ptime DelayParser::dateFromString(const String& string) { - std::istringstream stream(string.getUTF8String()); +boost::posix_time::ptime DelayParser::dateFromString(const std::string& string) { + std::istringstream stream(string); stream.imbue(locale); boost::posix_time::ptime result(boost::posix_time::not_a_date_time); stream >> result; return result; } -void DelayParser::handleStartElement(const String& /*element*/, const String& /*ns*/, const AttributeMap& attributes) { +void DelayParser::handleStartElement(const std::string& /*element*/, const std::string& /*ns*/, const AttributeMap& attributes) { if (level_ == 0) { boost::posix_time::ptime stamp = dateFromString(attributes.getAttribute("stamp")); getPayloadInternal()->setStamp(stamp); - if (!attributes.getAttribute("from").isEmpty()) { - String from = attributes.getAttribute("from"); + if (!attributes.getAttribute("from").empty()) { + std::string from = attributes.getAttribute("from"); getPayloadInternal()->setFrom(JID(from)); } } ++level_; } -void DelayParser::handleEndElement(const String&, const String&) { +void DelayParser::handleEndElement(const std::string&, const std::string&) { --level_; } -void DelayParser::handleCharacterData(const String&) { +void DelayParser::handleCharacterData(const std::string&) { } diff --git a/Swiften/Parser/PayloadParsers/DelayParser.h b/Swiften/Parser/PayloadParsers/DelayParser.h index b2fbdea..c2e2bb6 100644 --- a/Swiften/Parser/PayloadParsers/DelayParser.h +++ b/Swiften/Parser/PayloadParsers/DelayParser.h @@ -14,12 +14,12 @@ namespace Swift { public: DelayParser(const std::locale& locale); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: - boost::posix_time::ptime dateFromString(const String& string); + boost::posix_time::ptime dateFromString(const std::string& string); private: std::locale locale; diff --git a/Swiften/Parser/PayloadParsers/DelayParserFactory.h b/Swiften/Parser/PayloadParsers/DelayParserFactory.h index f3dd328..c150853 100644 --- a/Swiften/Parser/PayloadParsers/DelayParserFactory.h +++ b/Swiften/Parser/PayloadParsers/DelayParserFactory.h @@ -16,7 +16,7 @@ namespace Swift { public: DelayParserFactory(); - virtual bool canParse(const String& /*element*/, const String& ns, const AttributeMap&) const { + virtual bool canParse(const std::string& /*element*/, const std::string& ns, const AttributeMap&) const { return ns == "urn:xmpp:delay"; } diff --git a/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp b/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp index c47c703..e1fcb20 100644 --- a/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp +++ b/Swiften/Parser/PayloadParsers/DiscoInfoParser.cpp @@ -12,7 +12,7 @@ namespace Swift { DiscoInfoParser::DiscoInfoParser() : level_(TopLevel), formParser_(NULL) { } -void DiscoInfoParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void DiscoInfoParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "identity") { getPayloadInternal()->addIdentity(DiscoInfo::Identity(attributes.getAttribute("name"), attributes.getAttribute("category"), attributes.getAttribute("type"), attributes.getAttribute("lang"))); @@ -31,7 +31,7 @@ void DiscoInfoParser::handleStartElement(const String& element, const String& ns ++level_; } -void DiscoInfoParser::handleEndElement(const String& element, const String& ns) { +void DiscoInfoParser::handleEndElement(const std::string& element, const std::string& ns) { --level_; if (formParser_) { formParser_->handleEndElement(element, ns); @@ -43,7 +43,7 @@ void DiscoInfoParser::handleEndElement(const String& element, const String& ns) } } -void DiscoInfoParser::handleCharacterData(const String& data) { +void DiscoInfoParser::handleCharacterData(const std::string& data) { if (formParser_) { formParser_->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h index d9bfb54..24a1d6f 100644 --- a/Swiften/Parser/PayloadParsers/DiscoInfoParser.h +++ b/Swiften/Parser/PayloadParsers/DiscoInfoParser.h @@ -14,9 +14,9 @@ namespace Swift { public: DiscoInfoParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { diff --git a/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp b/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp index 0900354..7ff375b 100644 --- a/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp +++ b/Swiften/Parser/PayloadParsers/DiscoItemsParser.cpp @@ -11,7 +11,7 @@ namespace Swift { DiscoItemsParser::DiscoItemsParser() : level_(TopLevel) { } -void DiscoItemsParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void DiscoItemsParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "item") { getPayloadInternal()->addItem(DiscoItems::Item(attributes.getAttribute("name"), JID(attributes.getAttribute("jid")), attributes.getAttribute("node"))); @@ -20,11 +20,11 @@ void DiscoItemsParser::handleStartElement(const String& element, const String&, ++level_; } -void DiscoItemsParser::handleEndElement(const String&, const String&) { +void DiscoItemsParser::handleEndElement(const std::string&, const std::string&) { --level_; } -void DiscoItemsParser::handleCharacterData(const String&) { +void DiscoItemsParser::handleCharacterData(const std::string&) { } } diff --git a/Swiften/Parser/PayloadParsers/DiscoItemsParser.h b/Swiften/Parser/PayloadParsers/DiscoItemsParser.h index e3da34e..0700df6 100644 --- a/Swiften/Parser/PayloadParsers/DiscoItemsParser.h +++ b/Swiften/Parser/PayloadParsers/DiscoItemsParser.h @@ -14,9 +14,9 @@ namespace Swift { public: DiscoItemsParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.cpp b/Swiften/Parser/PayloadParsers/ErrorParser.cpp index 7ef4176..4034cb5 100644 --- a/Swiften/Parser/PayloadParsers/ErrorParser.cpp +++ b/Swiften/Parser/PayloadParsers/ErrorParser.cpp @@ -11,9 +11,9 @@ namespace Swift { ErrorParser::ErrorParser() : level_(TopLevel) { } -void ErrorParser::handleStartElement(const String&, const String&, const AttributeMap& attributes) { +void ErrorParser::handleStartElement(const std::string&, const std::string&, const AttributeMap& attributes) { if (level_ == TopLevel) { - String type = attributes.getAttribute("type"); + std::string type = attributes.getAttribute("type"); if (type == "continue") { getPayloadInternal()->setType(ErrorPayload::Continue); } @@ -33,7 +33,7 @@ void ErrorParser::handleStartElement(const String&, const String&, const Attribu ++level_; } -void ErrorParser::handleEndElement(const String& element, const String&) { +void ErrorParser::handleEndElement(const std::string& element, const std::string&) { --level_; if (level_ == PayloadLevel) { if (element == "text") { @@ -108,7 +108,7 @@ void ErrorParser::handleEndElement(const String& element, const String&) { } } -void ErrorParser::handleCharacterData(const String& data) { +void ErrorParser::handleCharacterData(const std::string& data) { currentText_ += data; } diff --git a/Swiften/Parser/PayloadParsers/ErrorParser.h b/Swiften/Parser/PayloadParsers/ErrorParser.h index 7642910..4318a8c 100644 --- a/Swiften/Parser/PayloadParsers/ErrorParser.h +++ b/Swiften/Parser/PayloadParsers/ErrorParser.h @@ -15,9 +15,9 @@ namespace Swift { public: ErrorParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -25,7 +25,7 @@ namespace Swift { PayloadLevel = 1 }; int level_; - String currentText_; + std::string currentText_; }; } diff --git a/Swiften/Parser/PayloadParsers/FormParser.cpp b/Swiften/Parser/PayloadParsers/FormParser.cpp index dc15ece..f8e02a4 100644 --- a/Swiften/Parser/PayloadParsers/FormParser.cpp +++ b/Swiften/Parser/PayloadParsers/FormParser.cpp @@ -11,9 +11,9 @@ namespace Swift { FormParser::FormParser() : level_(TopLevel) { } -void FormParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void FormParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level_ == TopLevel) { - String type = attributes.getAttribute("type"); + std::string type = attributes.getAttribute("type"); if (type == "form") { getPayloadInternal()->setType(Form::FormType); } @@ -35,7 +35,7 @@ void FormParser::handleStartElement(const String& element, const String&, const currentText_.clear(); } else if (element == "field") { - String type = attributes.getAttribute("type"); + std::string type = attributes.getAttribute("type"); if (type == "boolean") { currentFieldParseHelper_ = BooleanFormFieldParseHelper::create(); } @@ -84,12 +84,12 @@ void FormParser::handleStartElement(const String& element, const String&, const ++level_; } -void FormParser::handleEndElement(const String& element, const String&) { +void FormParser::handleEndElement(const std::string& element, const std::string&) { --level_; if (level_ == PayloadLevel) { if (element == "title") { - String currentTitle = getPayloadInternal()->getTitle(); - if (currentTitle.isEmpty()) { + std::string currentTitle = getPayloadInternal()->getTitle(); + if (currentTitle.empty()) { getPayloadInternal()->setTitle(currentText_); } else { @@ -97,8 +97,8 @@ void FormParser::handleEndElement(const String& element, const String&) { } } else if (element == "instructions") { - String currentInstructions = getPayloadInternal()->getInstructions(); - if (currentInstructions.isEmpty()) { + std::string currentInstructions = getPayloadInternal()->getInstructions(); + if (currentInstructions.empty()) { getPayloadInternal()->setInstructions(currentText_); } else { @@ -128,7 +128,7 @@ void FormParser::handleEndElement(const String& element, const String&) { } } -void FormParser::handleCharacterData(const String& text) { +void FormParser::handleCharacterData(const std::string& text) { currentText_ += text; } diff --git a/Swiften/Parser/PayloadParsers/FormParser.h b/Swiften/Parser/PayloadParsers/FormParser.h index c41e27f..90a3550 100644 --- a/Swiften/Parser/PayloadParsers/FormParser.h +++ b/Swiften/Parser/PayloadParsers/FormParser.h @@ -14,15 +14,15 @@ namespace Swift { public: FormParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: class FieldParseHelper { public: virtual ~FieldParseHelper() {} - virtual void addValue(const String&) = 0; + virtual void addValue(const std::string&) = 0; virtual boost::shared_ptr<FormField> getField() const { return field; } @@ -30,15 +30,15 @@ namespace Swift { boost::shared_ptr<FormField> field; }; class BoolFieldParseHelper : public FieldParseHelper { - virtual void addValue(const String& s) { + virtual void addValue(const std::string& s) { boost::dynamic_pointer_cast< GenericFormField<bool> >(getField())->setValue(s == "1" || s == "true"); getField()->addRawValue(s); } }; class StringFieldParseHelper : public FieldParseHelper { - virtual void addValue(const String& s) { - boost::shared_ptr<GenericFormField<String> > field = boost::dynamic_pointer_cast< GenericFormField<String> >(getField()); - if (field->getValue().isEmpty()) { + virtual void addValue(const std::string& s) { + boost::shared_ptr<GenericFormField<std::string> > field = boost::dynamic_pointer_cast< GenericFormField<std::string> >(getField()); + if (field->getValue().empty()) { field->setValue(s); } else { @@ -48,22 +48,22 @@ namespace Swift { } }; class JIDFieldParseHelper : public FieldParseHelper { - virtual void addValue(const String& s) { + virtual void addValue(const std::string& s) { boost::dynamic_pointer_cast< GenericFormField<JID> >(getField())->setValue(JID(s)); } }; class StringListFieldParseHelper : public FieldParseHelper { - virtual void addValue(const String& s) { + virtual void addValue(const std::string& s) { // FIXME: Inefficient, but too much hassle to do efficiently - boost::shared_ptr<GenericFormField< std::vector<String> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<String > > >(getField()); - std::vector<String> l = field->getValue(); + boost::shared_ptr<GenericFormField< std::vector<std::string> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<std::string > > >(getField()); + std::vector<std::string> l = field->getValue(); l.push_back(s); field->setValue(l); getField()->addRawValue(s); } }; class JIDListFieldParseHelper : public FieldParseHelper { - virtual void addValue(const String& s) { + virtual void addValue(const std::string& s) { // FIXME: Inefficient, but too much hassle to do efficiently boost::shared_ptr< GenericFormField< std::vector<JID> > > field = boost::dynamic_pointer_cast< GenericFormField<std::vector<JID > > >(getField()); std::vector<JID> l = field->getValue(); @@ -104,8 +104,8 @@ namespace Swift { FieldLevel = 2 }; int level_; - String currentText_; - String currentOptionLabel_; + std::string currentText_; + std::string currentOptionLabel_; boost::shared_ptr<FieldParseHelper> currentFieldParseHelper_; }; } diff --git a/Swiften/Parser/PayloadParsers/FormParserFactory.h b/Swiften/Parser/PayloadParsers/FormParserFactory.h index 805b0f1..7c095a7 100644 --- a/Swiften/Parser/PayloadParsers/FormParserFactory.h +++ b/Swiften/Parser/PayloadParsers/FormParserFactory.h @@ -17,7 +17,7 @@ namespace Swift { FormParserFactory() { } - virtual bool canParse(const String& /*element*/, const String& ns, const AttributeMap&) const { + virtual bool canParse(const std::string& /*element*/, const std::string& ns, const AttributeMap&) const { return ns == "jabber:x:data"; } diff --git a/Swiften/Parser/PayloadParsers/IBBParser.cpp b/Swiften/Parser/PayloadParsers/IBBParser.cpp index b2b4929..f36dc43 100644 --- a/Swiften/Parser/PayloadParsers/IBBParser.cpp +++ b/Swiften/Parser/PayloadParsers/IBBParser.cpp @@ -19,7 +19,7 @@ IBBParser::IBBParser() : level(TopLevel) { IBBParser::~IBBParser() { } -void IBBParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void IBBParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level == TopLevel) { if (element == "data") { getPayloadInternal()->setAction(IBB::Data); @@ -53,23 +53,23 @@ void IBBParser::handleStartElement(const String& element, const String&, const A ++level; } -void IBBParser::handleEndElement(const String& element, const String&) { +void IBBParser::handleEndElement(const std::string& element, const std::string&) { --level; if (level == TopLevel) { if (element == "data") { std::vector<char> data; - for (size_t i = 0; i < currentText.getUTF8Size(); ++i) { + for (size_t i = 0; i < currentText.size(); ++i) { char c = currentText[i]; if (c >= 48 && c <= 122) { data.push_back(c); } } - getPayloadInternal()->setData(Base64::decode(String(&data[0], data.size()))); + getPayloadInternal()->setData(Base64::decode(std::string(&data[0], data.size()))); } } } -void IBBParser::handleCharacterData(const String& data) { +void IBBParser::handleCharacterData(const std::string& data) { currentText += data; } diff --git a/Swiften/Parser/PayloadParsers/IBBParser.h b/Swiften/Parser/PayloadParsers/IBBParser.h index 1fc062f..132e79d 100644 --- a/Swiften/Parser/PayloadParsers/IBBParser.h +++ b/Swiften/Parser/PayloadParsers/IBBParser.h @@ -17,15 +17,15 @@ namespace Swift { IBBParser(); ~IBBParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { TopLevel = 0, }; int level; - String currentText; + std::string currentText; }; } diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp index 5a9b3d8..2ec1916 100644 --- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.cpp @@ -18,7 +18,7 @@ InBandRegistrationPayloadParser::~InBandRegistrationPayloadParser() { delete formParserFactory; } -void InBandRegistrationPayloadParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void InBandRegistrationPayloadParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == TopLevel) { } else if (level == PayloadLevel) { @@ -38,7 +38,7 @@ void InBandRegistrationPayloadParser::handleStartElement(const String& element, ++level; } -void InBandRegistrationPayloadParser::handleEndElement(const String& element, const String& ns) { +void InBandRegistrationPayloadParser::handleEndElement(const std::string& element, const std::string& ns) { --level; if (formParser) { @@ -116,7 +116,7 @@ void InBandRegistrationPayloadParser::handleEndElement(const String& element, co } } -void InBandRegistrationPayloadParser::handleCharacterData(const String& data) { +void InBandRegistrationPayloadParser::handleCharacterData(const std::string& data) { if (formParser) { formParser->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h index d616e70..c0209c4 100644 --- a/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/InBandRegistrationPayloadParser.h @@ -20,9 +20,9 @@ namespace Swift { InBandRegistrationPayloadParser(); ~InBandRegistrationPayloadParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -32,6 +32,6 @@ namespace Swift { int level; FormParserFactory* formParserFactory; FormParser* formParser; - String currentText; + std::string currentText; }; } diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp index 65417a7..ec9e200 100644 --- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.cpp @@ -18,27 +18,27 @@ namespace Swift { MUCUserPayloadParser::MUCUserPayloadParser() : level(TopLevel) { } -void MUCUserPayloadParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void MUCUserPayloadParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level == ItemLevel) { if (element == "item") { MUCUserPayload::Item item; - String affiliation = attributes.getAttribute("affiliation"); - String role = attributes.getAttribute("role"); - String nick = attributes.getAttribute("nick"); - String jid = attributes.getAttribute("jid"); + std::string affiliation = attributes.getAttribute("affiliation"); + std::string role = attributes.getAttribute("role"); + std::string nick = attributes.getAttribute("nick"); + std::string jid = attributes.getAttribute("jid"); item.affiliation = parseAffiliation(affiliation); item.role = parseRole(role); - if (!jid.isEmpty()) { + if (!jid.empty()) { item.realJID = JID(jid); } - if (!nick.isEmpty()) { + if (!nick.empty()) { item.nick = nick; } getPayloadInternal()->addItem(item); } else if (element == "status") { MUCUserPayload::StatusCode status; try { - status.code = boost::lexical_cast<int>(attributes.getAttribute("code").getUTF8Data()); + status.code = boost::lexical_cast<int>(attributes.getAttribute("code").c_str()); getPayloadInternal()->addStatusCode(status); } catch (boost::bad_lexical_cast&) { } @@ -47,7 +47,7 @@ void MUCUserPayloadParser::handleStartElement(const String& element, const Strin ++level; } -MUCOccupant::Role MUCUserPayloadParser::parseRole(const String& roleString) const { +MUCOccupant::Role MUCUserPayloadParser::parseRole(const std::string& roleString) const { if (roleString == "moderator") { return MUCOccupant::Moderator; } @@ -63,7 +63,7 @@ MUCOccupant::Role MUCUserPayloadParser::parseRole(const String& roleString) cons return MUCOccupant::NoRole; } -MUCOccupant::Affiliation MUCUserPayloadParser::parseAffiliation(const String& affiliationString) const { +MUCOccupant::Affiliation MUCUserPayloadParser::parseAffiliation(const std::string& affiliationString) const { if (affiliationString == "owner") { return MUCOccupant::Owner; } @@ -83,11 +83,11 @@ MUCOccupant::Affiliation MUCUserPayloadParser::parseAffiliation(const String& af } -void MUCUserPayloadParser::handleEndElement(const String& /*element*/, const String&) { +void MUCUserPayloadParser::handleEndElement(const std::string& /*element*/, const std::string&) { --level; } -void MUCUserPayloadParser::handleCharacterData(const String& /*data*/) { +void MUCUserPayloadParser::handleCharacterData(const std::string& /*data*/) { } diff --git a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h index 01c7de1..384f0cd 100644 --- a/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/MUCUserPayloadParser.h @@ -16,11 +16,11 @@ namespace Swift { public: MUCUserPayloadParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); - MUCOccupant::Role parseRole(const String& itemString) const; - MUCOccupant::Affiliation parseAffiliation(const String& statusString) const; + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); + MUCOccupant::Role parseRole(const std::string& itemString) const; + MUCOccupant::Affiliation parseAffiliation(const std::string& statusString) const; private: enum Level { TopLevel = 0, diff --git a/Swiften/Parser/PayloadParsers/NicknameParser.cpp b/Swiften/Parser/PayloadParsers/NicknameParser.cpp index c60bc72..cd7ec27 100644 --- a/Swiften/Parser/PayloadParsers/NicknameParser.cpp +++ b/Swiften/Parser/PayloadParsers/NicknameParser.cpp @@ -11,18 +11,18 @@ namespace Swift { NicknameParser::NicknameParser() : level(0) { } -void NicknameParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void NicknameParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level; } -void NicknameParser::handleEndElement(const String&, const String&) { +void NicknameParser::handleEndElement(const std::string&, const std::string&) { --level; if (level == 0) { getPayloadInternal()->setNickname(text); } } -void NicknameParser::handleCharacterData(const String& data) { +void NicknameParser::handleCharacterData(const std::string& data) { text += data; } diff --git a/Swiften/Parser/PayloadParsers/NicknameParser.h b/Swiften/Parser/PayloadParsers/NicknameParser.h index 24003b8..6e723c8 100644 --- a/Swiften/Parser/PayloadParsers/NicknameParser.h +++ b/Swiften/Parser/PayloadParsers/NicknameParser.h @@ -14,12 +14,12 @@ namespace Swift { public: NicknameParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level; - String text; + std::string text; }; } diff --git a/Swiften/Parser/PayloadParsers/PriorityParser.cpp b/Swiften/Parser/PayloadParsers/PriorityParser.cpp index 8872977..bcbf67f 100644 --- a/Swiften/Parser/PayloadParsers/PriorityParser.cpp +++ b/Swiften/Parser/PayloadParsers/PriorityParser.cpp @@ -13,11 +13,11 @@ namespace Swift { PriorityParser::PriorityParser() : level_(0) { } -void PriorityParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void PriorityParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void PriorityParser::handleEndElement(const String&, const String&) { +void PriorityParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 0) { int priority = 0; @@ -30,7 +30,7 @@ void PriorityParser::handleEndElement(const String&, const String&) { } } -void PriorityParser::handleCharacterData(const String& data) { +void PriorityParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/PriorityParser.h b/Swiften/Parser/PayloadParsers/PriorityParser.h index e9ce592..1b02255 100644 --- a/Swiften/Parser/PayloadParsers/PriorityParser.h +++ b/Swiften/Parser/PayloadParsers/PriorityParser.h @@ -15,13 +15,13 @@ namespace Swift { public: PriorityParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp b/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp index 2cbe741..026da96 100644 --- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp +++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.cpp @@ -13,7 +13,7 @@ namespace Swift { PrivateStorageParser::PrivateStorageParser(PayloadParserFactoryCollection* factories) : factories(factories), level(0) { } -void PrivateStorageParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void PrivateStorageParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == 1) { PayloadParserFactory* payloadParserFactory = factories->getPayloadParserFactory(element, ns, attributes); if (payloadParserFactory) { @@ -27,7 +27,7 @@ void PrivateStorageParser::handleStartElement(const String& element, const Strin ++level; } -void PrivateStorageParser::handleEndElement(const String& element, const String& ns) { +void PrivateStorageParser::handleEndElement(const std::string& element, const std::string& ns) { --level; if (currentPayloadParser.get()) { if (level >= 1) { @@ -40,7 +40,7 @@ void PrivateStorageParser::handleEndElement(const String& element, const String& } } -void PrivateStorageParser::handleCharacterData(const String& data) { +void PrivateStorageParser::handleCharacterData(const std::string& data) { if (level > 1 && currentPayloadParser.get()) { currentPayloadParser->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h index 1340ba1..f5f569a 100644 --- a/Swiften/Parser/PayloadParsers/PrivateStorageParser.h +++ b/Swiften/Parser/PayloadParsers/PrivateStorageParser.h @@ -19,9 +19,9 @@ namespace Swift { PrivateStorageParser(PayloadParserFactoryCollection* factories); private: - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: PayloadParserFactoryCollection* factories; diff --git a/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h b/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h index 53bb1ec..9399ace 100644 --- a/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h +++ b/Swiften/Parser/PayloadParsers/PrivateStorageParserFactory.h @@ -17,7 +17,7 @@ namespace Swift { PrivateStorageParserFactory(PayloadParserFactoryCollection* factories) : factories(factories) { } - virtual bool canParse(const String& element, const String& ns, const AttributeMap&) const { + virtual bool canParse(const std::string& element, const std::string& ns, const AttributeMap&) const { return element == "query" && ns == "jabber:iq:private"; } diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp index 589e9d9..bc9b843 100644 --- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.cpp @@ -12,12 +12,12 @@ namespace Swift { RawXMLPayloadParser::RawXMLPayloadParser() : level_(0) { } -void RawXMLPayloadParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void RawXMLPayloadParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { ++level_; serializingParser_.handleStartElement(element, ns, attributes); } -void RawXMLPayloadParser::handleEndElement(const String& element, const String& ns) { +void RawXMLPayloadParser::handleEndElement(const std::string& element, const std::string& ns) { serializingParser_.handleEndElement(element, ns); --level_; if (level_ == 0) { @@ -25,7 +25,7 @@ void RawXMLPayloadParser::handleEndElement(const String& element, const String& } } -void RawXMLPayloadParser::handleCharacterData(const String& data) { +void RawXMLPayloadParser::handleCharacterData(const std::string& data) { serializingParser_.handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h index eedc85b..b5c887a 100644 --- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h @@ -17,9 +17,9 @@ namespace Swift { public: RawXMLPayloadParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; diff --git a/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h b/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h index 755fb08..b180e1e 100644 --- a/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h +++ b/Swiften/Parser/PayloadParsers/RawXMLPayloadParserFactory.h @@ -8,14 +8,14 @@ #include "Swiften/Parser/PayloadParserFactory.h" #include "Swiften/Parser/PayloadParsers/RawXMLPayloadParser.h" -#include "Swiften/Base/String.h" +#include <string> namespace Swift { class RawXMLPayloadParserFactory : public PayloadParserFactory { public: RawXMLPayloadParserFactory() {} - virtual bool canParse(const String&, const String&, const AttributeMap&) const { + virtual bool canParse(const std::string&, const std::string&, const AttributeMap&) const { return true; } diff --git a/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp b/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp index 92929bf..5c3affb 100644 --- a/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp +++ b/Swiften/Parser/PayloadParsers/ResourceBindParser.cpp @@ -11,7 +11,7 @@ namespace Swift { ResourceBindParser::ResourceBindParser() : level_(0), inJID_(false), inResource_(false) { } -void ResourceBindParser::handleStartElement(const String& element, const String&, const AttributeMap&) { +void ResourceBindParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap&) { if (level_ == 1) { text_ = ""; if (element == "resource") { @@ -24,7 +24,7 @@ void ResourceBindParser::handleStartElement(const String& element, const String& ++level_; } -void ResourceBindParser::handleEndElement(const String&, const String&) { +void ResourceBindParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 1) { if (inJID_) { @@ -36,7 +36,7 @@ void ResourceBindParser::handleEndElement(const String&, const String&) { } } -void ResourceBindParser::handleCharacterData(const String& data) { +void ResourceBindParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/ResourceBindParser.h b/Swiften/Parser/PayloadParsers/ResourceBindParser.h index 890f28a..875b5f4 100644 --- a/Swiften/Parser/PayloadParsers/ResourceBindParser.h +++ b/Swiften/Parser/PayloadParsers/ResourceBindParser.h @@ -15,15 +15,15 @@ namespace Swift { public: ResourceBindParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; bool inJID_; bool inResource_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/RosterParser.cpp b/Swiften/Parser/PayloadParsers/RosterParser.cpp index a8dd63e..ba19fbf 100644 --- a/Swiften/Parser/PayloadParsers/RosterParser.cpp +++ b/Swiften/Parser/PayloadParsers/RosterParser.cpp @@ -12,7 +12,7 @@ namespace Swift { RosterParser::RosterParser() : level_(TopLevel), inItem_(false), unknownContentParser_(0) { } -void RosterParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void RosterParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level_ == PayloadLevel) { if (element == "item") { inItem_ = true; @@ -21,7 +21,7 @@ void RosterParser::handleStartElement(const String& element, const String& ns, c currentItem_.setJID(JID(attributes.getAttribute("jid"))); currentItem_.setName(attributes.getAttribute("name")); - String subscription = attributes.getAttribute("subscription"); + std::string subscription = attributes.getAttribute("subscription"); if (subscription == "both") { currentItem_.setSubscription(RosterItemPayload::Both); } @@ -59,7 +59,7 @@ void RosterParser::handleStartElement(const String& element, const String& ns, c ++level_; } -void RosterParser::handleEndElement(const String& element, const String& ns) { +void RosterParser::handleEndElement(const std::string& element, const std::string& ns) { --level_; if (level_ == PayloadLevel) { if (inItem_) { @@ -83,7 +83,7 @@ void RosterParser::handleEndElement(const String& element, const String& ns) { } } -void RosterParser::handleCharacterData(const String& data) { +void RosterParser::handleCharacterData(const std::string& data) { if (unknownContentParser_) { unknownContentParser_->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/RosterParser.h b/Swiften/Parser/PayloadParsers/RosterParser.h index 4a28618..ac72696 100644 --- a/Swiften/Parser/PayloadParsers/RosterParser.h +++ b/Swiften/Parser/PayloadParsers/RosterParser.h @@ -17,9 +17,9 @@ namespace Swift { public: RosterParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -30,7 +30,7 @@ namespace Swift { int level_; bool inItem_; RosterItemPayload currentItem_; - String currentText_; + std::string currentText_; SerializingParser* unknownContentParser_; }; } diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp b/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp index f2cf1dd..7c8752c 100644 --- a/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp +++ b/Swiften/Parser/PayloadParsers/SearchPayloadParser.cpp @@ -18,7 +18,7 @@ SearchPayloadParser::~SearchPayloadParser() { delete formParserFactory; } -void SearchPayloadParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void SearchPayloadParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == TopLevel) { } else if (level == PayloadLevel) { @@ -46,7 +46,7 @@ void SearchPayloadParser::handleStartElement(const String& element, const String ++level; } -void SearchPayloadParser::handleEndElement(const String& element, const String& ns) { +void SearchPayloadParser::handleEndElement(const std::string& element, const std::string& ns) { --level; if (formParser) { @@ -98,7 +98,7 @@ void SearchPayloadParser::handleEndElement(const String& element, const String& } } -void SearchPayloadParser::handleCharacterData(const String& data) { +void SearchPayloadParser::handleCharacterData(const std::string& data) { if (formParser) { formParser->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/SearchPayloadParser.h b/Swiften/Parser/PayloadParsers/SearchPayloadParser.h index 55177b0..01441e8 100644 --- a/Swiften/Parser/PayloadParsers/SearchPayloadParser.h +++ b/Swiften/Parser/PayloadParsers/SearchPayloadParser.h @@ -20,9 +20,9 @@ namespace Swift { SearchPayloadParser(); ~SearchPayloadParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -33,7 +33,7 @@ namespace Swift { int level; FormParserFactory* formParserFactory; FormParser* formParser; - String currentText; + std::string currentText; boost::optional<SearchPayload::Item> currentItem; }; } diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp index eac297b..bf134d7 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp +++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.cpp @@ -12,7 +12,7 @@ namespace Swift { SecurityLabelParser::SecurityLabelParser() : level_(TopLevel), labelParser_(0) { } -void SecurityLabelParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void SecurityLabelParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { ++level_; if (level_ == DisplayMarkingOrLabelLevel) { if (element == "displaymarking") { @@ -30,7 +30,7 @@ void SecurityLabelParser::handleStartElement(const String& element, const String } } -void SecurityLabelParser::handleEndElement(const String& element, const String& ns) { +void SecurityLabelParser::handleEndElement(const std::string& element, const std::string& ns) { if (level_ == DisplayMarkingOrLabelLevel) { if (element == "displaymarking") { getPayloadInternal()->setDisplayMarking(currentText_); @@ -53,7 +53,7 @@ void SecurityLabelParser::handleEndElement(const String& element, const String& } -void SecurityLabelParser::handleCharacterData(const String& data) { +void SecurityLabelParser::handleCharacterData(const std::string& data) { if (labelParser_) { labelParser_->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h index cc62e10..bd80921 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelParser.h +++ b/Swiften/Parser/PayloadParsers/SecurityLabelParser.h @@ -17,9 +17,9 @@ namespace Swift { public: SecurityLabelParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -30,7 +30,7 @@ namespace Swift { }; int level_; SerializingParser* labelParser_; - String currentText_; + std::string currentText_; }; } diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp index abe392f..1f2a6bc 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp +++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.cpp @@ -18,7 +18,7 @@ SecurityLabelsCatalogParser::~SecurityLabelsCatalogParser() { delete labelParserFactory_; } -void SecurityLabelsCatalogParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void SecurityLabelsCatalogParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { ++level_; if (level_ == PayloadLevel) { getPayloadInternal()->setTo(JID(attributes.getAttribute("to"))); @@ -38,7 +38,7 @@ void SecurityLabelsCatalogParser::handleStartElement(const String& element, cons } } -void SecurityLabelsCatalogParser::handleEndElement(const String& element, const String& ns) { +void SecurityLabelsCatalogParser::handleEndElement(const std::string& element, const std::string& ns) { if (labelParser_) { labelParser_->handleEndElement(element, ns); } @@ -52,7 +52,7 @@ void SecurityLabelsCatalogParser::handleEndElement(const String& element, const --level_; } -void SecurityLabelsCatalogParser::handleCharacterData(const String& data) { +void SecurityLabelsCatalogParser::handleCharacterData(const std::string& data) { if (labelParser_) { labelParser_->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h index 36a54cb..2222117 100644 --- a/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h +++ b/Swiften/Parser/PayloadParsers/SecurityLabelsCatalogParser.h @@ -19,9 +19,9 @@ namespace Swift { SecurityLabelsCatalogParser(); ~SecurityLabelsCatalogParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { diff --git a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp index 95d29a7..f8e61c7 100644 --- a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp +++ b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.cpp @@ -11,11 +11,11 @@ namespace Swift { SoftwareVersionParser::SoftwareVersionParser() : level_(TopLevel) { } -void SoftwareVersionParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void SoftwareVersionParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void SoftwareVersionParser::handleEndElement(const String& element, const String&) { +void SoftwareVersionParser::handleEndElement(const std::string& element, const std::string&) { --level_; if (level_ == PayloadLevel) { if (element == "name") { @@ -31,7 +31,7 @@ void SoftwareVersionParser::handleEndElement(const String& element, const String } } -void SoftwareVersionParser::handleCharacterData(const String& data) { +void SoftwareVersionParser::handleCharacterData(const std::string& data) { currentText_ += data; } diff --git a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h index de9a47c..4272e5a 100644 --- a/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h +++ b/Swiften/Parser/PayloadParsers/SoftwareVersionParser.h @@ -15,9 +15,9 @@ namespace Swift { public: SoftwareVersionParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -25,7 +25,7 @@ namespace Swift { PayloadLevel = 1 }; int level_; - String currentText_; + std::string currentText_; }; } diff --git a/Swiften/Parser/PayloadParsers/StartSessionParser.h b/Swiften/Parser/PayloadParsers/StartSessionParser.h index 42090ad..ba6e3c8 100644 --- a/Swiften/Parser/PayloadParsers/StartSessionParser.h +++ b/Swiften/Parser/PayloadParsers/StartSessionParser.h @@ -15,9 +15,9 @@ namespace Swift { public: StartSessionParser() {} - virtual void handleStartElement(const String&, const String&, const AttributeMap&) {} - virtual void handleEndElement(const String&, const String&) {} - virtual void handleCharacterData(const String&) {} + virtual void handleStartElement(const std::string&, const std::string&, const AttributeMap&) {} + virtual void handleEndElement(const std::string&, const std::string&) {} + virtual void handleCharacterData(const std::string&) {} }; } diff --git a/Swiften/Parser/PayloadParsers/StatusParser.cpp b/Swiften/Parser/PayloadParsers/StatusParser.cpp index 7188fb3..a5d00de 100644 --- a/Swiften/Parser/PayloadParsers/StatusParser.cpp +++ b/Swiften/Parser/PayloadParsers/StatusParser.cpp @@ -11,18 +11,18 @@ namespace Swift { StatusParser::StatusParser() : level_(0) { } -void StatusParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void StatusParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void StatusParser::handleEndElement(const String&, const String&) { +void StatusParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 0) { getPayloadInternal()->setText(text_); } } -void StatusParser::handleCharacterData(const String& data) { +void StatusParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/StatusParser.h b/Swiften/Parser/PayloadParsers/StatusParser.h index 87e118e..4c6f4ac 100644 --- a/Swiften/Parser/PayloadParsers/StatusParser.h +++ b/Swiften/Parser/PayloadParsers/StatusParser.h @@ -15,13 +15,13 @@ namespace Swift { public: StatusParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/StatusShowParser.cpp b/Swiften/Parser/PayloadParsers/StatusShowParser.cpp index 0fd4dd8..774f27d 100644 --- a/Swiften/Parser/PayloadParsers/StatusShowParser.cpp +++ b/Swiften/Parser/PayloadParsers/StatusShowParser.cpp @@ -11,11 +11,11 @@ namespace Swift { StatusShowParser::StatusShowParser() : level_(0) { } -void StatusShowParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void StatusShowParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void StatusShowParser::handleEndElement(const String&, const String&) { +void StatusShowParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 0) { if (text_ == "away") { @@ -36,7 +36,7 @@ void StatusShowParser::handleEndElement(const String&, const String&) { } } -void StatusShowParser::handleCharacterData(const String& data) { +void StatusShowParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/StatusShowParser.h b/Swiften/Parser/PayloadParsers/StatusShowParser.h index f6563a4..b4100a3 100644 --- a/Swiften/Parser/PayloadParsers/StatusShowParser.h +++ b/Swiften/Parser/PayloadParsers/StatusShowParser.h @@ -15,13 +15,13 @@ namespace Swift { public: StatusShowParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/StorageParser.cpp b/Swiften/Parser/PayloadParsers/StorageParser.cpp index c82b82c..94cd0ce 100644 --- a/Swiften/Parser/PayloadParsers/StorageParser.cpp +++ b/Swiften/Parser/PayloadParsers/StorageParser.cpp @@ -13,7 +13,7 @@ namespace Swift { StorageParser::StorageParser() : level(TopLevel) { } -void StorageParser::handleStartElement(const String& element, const String&, const AttributeMap& attributes) { +void StorageParser::handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes) { if (level == BookmarkLevel) { if (element == "conference") { assert(!room); @@ -35,7 +35,7 @@ void StorageParser::handleStartElement(const String& element, const String&, con ++level; } -void StorageParser::handleEndElement(const String& element, const String&) { +void StorageParser::handleEndElement(const std::string& element, const std::string&) { --level; if (level == BookmarkLevel) { if (element == "conference") { @@ -59,7 +59,7 @@ void StorageParser::handleEndElement(const String& element, const String&) { } } -void StorageParser::handleCharacterData(const String& data) { +void StorageParser::handleCharacterData(const std::string& data) { currentText += data; } diff --git a/Swiften/Parser/PayloadParsers/StorageParser.h b/Swiften/Parser/PayloadParsers/StorageParser.h index a8bd4a2..16fd869 100644 --- a/Swiften/Parser/PayloadParsers/StorageParser.h +++ b/Swiften/Parser/PayloadParsers/StorageParser.h @@ -16,9 +16,9 @@ namespace Swift { public: StorageParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -27,7 +27,7 @@ namespace Swift { DetailLevel = 2 }; int level; - String currentText; + std::string currentText; boost::optional<Storage::Room> room; boost::optional<Storage::URL> url; }; diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp index bf36321..28c5cf5 100644 --- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp +++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.cpp @@ -26,10 +26,10 @@ StreamInitiationParser::~StreamInitiationParser() { delete formParserFactory; } -void StreamInitiationParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void StreamInitiationParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == TopLevel) { getPayloadInternal()->setID(attributes.getAttribute("id")); - if (!attributes.getAttribute("profile").isEmpty()) { + if (!attributes.getAttribute("profile").empty()) { getPayloadInternal()->setIsFileTransfer(attributes.getAttribute("profile") == FILE_TRANSFER_NS); } } @@ -64,7 +64,7 @@ void StreamInitiationParser::handleStartElement(const String& element, const Str ++level; } -void StreamInitiationParser::handleEndElement(const String& element, const String& ns) { +void StreamInitiationParser::handleEndElement(const std::string& element, const std::string& ns) { --level; if (formParser) { formParser->handleEndElement(element, ns); @@ -107,7 +107,7 @@ void StreamInitiationParser::handleEndElement(const String& element, const Strin } } -void StreamInitiationParser::handleCharacterData(const String& data) { +void StreamInitiationParser::handleCharacterData(const std::string& data) { if (formParser) { formParser->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/StreamInitiationParser.h b/Swiften/Parser/PayloadParsers/StreamInitiationParser.h index 7a44651..46f5b2f 100644 --- a/Swiften/Parser/PayloadParsers/StreamInitiationParser.h +++ b/Swiften/Parser/PayloadParsers/StreamInitiationParser.h @@ -20,9 +20,9 @@ namespace Swift { StreamInitiationParser(); ~StreamInitiationParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -37,6 +37,6 @@ namespace Swift { bool inFile; bool inFeature; StreamInitiationFileInfo currentFile; - String currentText; + std::string currentText; }; } diff --git a/Swiften/Parser/PayloadParsers/SubjectParser.cpp b/Swiften/Parser/PayloadParsers/SubjectParser.cpp index d28fb7d..d7d9af8 100644 --- a/Swiften/Parser/PayloadParsers/SubjectParser.cpp +++ b/Swiften/Parser/PayloadParsers/SubjectParser.cpp @@ -11,18 +11,18 @@ namespace Swift { SubjectParser::SubjectParser() : level_(0) { } -void SubjectParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void SubjectParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { ++level_; } -void SubjectParser::handleEndElement(const String&, const String&) { +void SubjectParser::handleEndElement(const std::string&, const std::string&) { --level_; if (level_ == 0) { getPayloadInternal()->setText(text_); } } -void SubjectParser::handleCharacterData(const String& data) { +void SubjectParser::handleCharacterData(const std::string& data) { text_ += data; } diff --git a/Swiften/Parser/PayloadParsers/SubjectParser.h b/Swiften/Parser/PayloadParsers/SubjectParser.h index a7b8a89..78e5a9e 100644 --- a/Swiften/Parser/PayloadParsers/SubjectParser.h +++ b/Swiften/Parser/PayloadParsers/SubjectParser.h @@ -14,12 +14,12 @@ namespace Swift { public: SubjectParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: int level_; - String text_; + std::string text_; }; } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp index b03a418..bb53586 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/BodyParserTest.cpp @@ -27,7 +27,7 @@ class BodyParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("<body>foo<baz>bar</baz>fum</body>")); Body* payload = dynamic_cast<Body*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("foobarfum"), payload->getText()); + CPPUNIT_ASSERT_EQUAL(std::string("foobarfum"), payload->getText()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp index 5f11718..7ebcbac 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/CommandParserTest.cpp @@ -29,8 +29,8 @@ class CommandParserTest : public CppUnit::TestFixture { Command::ref payload = parser.getPayload<Command>(); CPPUNIT_ASSERT_EQUAL(Command::Prev, payload->getAction()); - CPPUNIT_ASSERT_EQUAL(String("list"), payload->getNode()); - CPPUNIT_ASSERT_EQUAL(String("myid"), payload->getSessionID()); + CPPUNIT_ASSERT_EQUAL(std::string("list"), payload->getNode()); + CPPUNIT_ASSERT_EQUAL(std::string("myid"), payload->getSessionID()); } void testParse_Result() { @@ -52,9 +52,9 @@ class CommandParserTest : public CppUnit::TestFixture { std::vector<Command::Note> notes = payload->getNotes(); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(notes.size())); CPPUNIT_ASSERT_EQUAL(Command::Note::Warn, notes[0].type); - CPPUNIT_ASSERT_EQUAL(String("Service 'httpd' has been configured."), notes[0].note); + CPPUNIT_ASSERT_EQUAL(std::string("Service 'httpd' has been configured."), notes[0].note); CPPUNIT_ASSERT_EQUAL(Command::Note::Error, notes[1].type); - CPPUNIT_ASSERT_EQUAL(String("I lied."), notes[1].note); + CPPUNIT_ASSERT_EQUAL(std::string("I lied."), notes[1].note); std::vector<Command::Action> actions = payload->getAvailableActions(); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(actions.size())); CPPUNIT_ASSERT_EQUAL(Command::Prev, actions[0]); @@ -77,8 +77,8 @@ class CommandParserTest : public CppUnit::TestFixture { Command::ref payload = parser.getPayload<Command>(); Form::ref form = payload->getForm(); - CPPUNIT_ASSERT_EQUAL(String("Bot Configuration"), form->getTitle()); - CPPUNIT_ASSERT_EQUAL(String("Hello!\nFill out this form to configure your new bot!"), form->getInstructions()); + CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), form->getTitle()); + CPPUNIT_ASSERT_EQUAL(std::string("Hello!\nFill out this form to configure your new bot!"), form->getInstructions()); CPPUNIT_ASSERT_EQUAL(Form::ResultType, form->getType()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp index 5d9e365..793e0c2 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/DiscoInfoParserTest.cpp @@ -33,18 +33,18 @@ class DiscoInfoParserTest : public CppUnit::TestFixture { DiscoInfo::ref payload = boost::dynamic_pointer_cast<DiscoInfo>(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getIdentities().size())); - CPPUNIT_ASSERT_EQUAL(String("Swift"), payload->getIdentities()[0].getName()); - CPPUNIT_ASSERT_EQUAL(String("pc"), payload->getIdentities()[0].getType()); - CPPUNIT_ASSERT_EQUAL(String("client"), payload->getIdentities()[0].getCategory()); - CPPUNIT_ASSERT_EQUAL(String("en"), payload->getIdentities()[0].getLanguage()); - CPPUNIT_ASSERT_EQUAL(String("Vlug"), payload->getIdentities()[1].getName()); - CPPUNIT_ASSERT_EQUAL(String("pc"), payload->getIdentities()[1].getType()); - CPPUNIT_ASSERT_EQUAL(String("client"), payload->getIdentities()[1].getCategory()); - CPPUNIT_ASSERT_EQUAL(String("nl"), payload->getIdentities()[1].getLanguage()); + CPPUNIT_ASSERT_EQUAL(std::string("Swift"), payload->getIdentities()[0].getName()); + CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[0].getType()); + CPPUNIT_ASSERT_EQUAL(std::string("client"), payload->getIdentities()[0].getCategory()); + CPPUNIT_ASSERT_EQUAL(std::string("en"), payload->getIdentities()[0].getLanguage()); + CPPUNIT_ASSERT_EQUAL(std::string("Vlug"), payload->getIdentities()[1].getName()); + CPPUNIT_ASSERT_EQUAL(std::string("pc"), payload->getIdentities()[1].getType()); + CPPUNIT_ASSERT_EQUAL(std::string("client"), payload->getIdentities()[1].getCategory()); + CPPUNIT_ASSERT_EQUAL(std::string("nl"), payload->getIdentities()[1].getLanguage()); CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(payload->getFeatures().size())); - CPPUNIT_ASSERT_EQUAL(String("foo-feature"), payload->getFeatures()[0]); - CPPUNIT_ASSERT_EQUAL(String("bar-feature"), payload->getFeatures()[1]); - CPPUNIT_ASSERT_EQUAL(String("baz-feature"), payload->getFeatures()[2]); + CPPUNIT_ASSERT_EQUAL(std::string("foo-feature"), payload->getFeatures()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("bar-feature"), payload->getFeatures()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("baz-feature"), payload->getFeatures()[2]); } void testParse_Form() { @@ -62,10 +62,10 @@ class DiscoInfoParserTest : public CppUnit::TestFixture { DiscoInfo::ref payload = boost::dynamic_pointer_cast<DiscoInfo>(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(payload->getExtensions().size())); - CPPUNIT_ASSERT_EQUAL(String("Bot Configuration"), payload->getExtensions()[0]->getTitle()); + CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), payload->getExtensions()[0]->getTitle()); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getFeatures().size())); - CPPUNIT_ASSERT_EQUAL(String("foo-feature"), payload->getFeatures()[0]); - CPPUNIT_ASSERT_EQUAL(String("bar-feature"), payload->getFeatures()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("foo-feature"), payload->getFeatures()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("bar-feature"), payload->getFeatures()[1]); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp index 618ce6d..02c2f7d 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ErrorParserTest.cpp @@ -30,7 +30,7 @@ class ErrorParserTest : public CppUnit::TestFixture { ErrorPayload::ref payload = boost::dynamic_pointer_cast<ErrorPayload>(parser.getPayload()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::BadRequest, payload->getCondition()); CPPUNIT_ASSERT_EQUAL(ErrorPayload::Modify, payload->getType()); - CPPUNIT_ASSERT_EQUAL(String("boo"), payload->getText()); + CPPUNIT_ASSERT_EQUAL(std::string("boo"), payload->getText()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp index aede75d..6ec825b 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/FormParserTest.cpp @@ -31,8 +31,8 @@ class FormParserTest : public CppUnit::TestFixture { )); Form* payload = dynamic_cast<Form*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("Bot Configuration"), payload->getTitle()); - CPPUNIT_ASSERT_EQUAL(String("Hello!\nFill out this form to configure your new bot!"), payload->getInstructions()); + CPPUNIT_ASSERT_EQUAL(std::string("Bot Configuration"), payload->getTitle()); + CPPUNIT_ASSERT_EQUAL(std::string("Hello!\nFill out this form to configure your new bot!"), payload->getInstructions()); CPPUNIT_ASSERT_EQUAL(Form::SubmitType, payload->getType()); } @@ -84,38 +84,38 @@ class FormParserTest : public CppUnit::TestFixture { Form* payload = dynamic_cast<Form*>(parser.getPayload().get()); CPPUNIT_ASSERT_EQUAL(10, static_cast<int>(payload->getFields().size())); - CPPUNIT_ASSERT_EQUAL(String("jabber:bot"), boost::dynamic_pointer_cast<HiddenFormField>(payload->getFields()[0])->getValue()); - CPPUNIT_ASSERT_EQUAL(String("FORM_TYPE"), payload->getFields()[0]->getName()); + CPPUNIT_ASSERT_EQUAL(std::string("jabber:bot"), boost::dynamic_pointer_cast<HiddenFormField>(payload->getFields()[0])->getValue()); + CPPUNIT_ASSERT_EQUAL(std::string("FORM_TYPE"), payload->getFields()[0]->getName()); CPPUNIT_ASSERT(!payload->getFields()[0]->getRequired()); - CPPUNIT_ASSERT_EQUAL(String("Section 1: Bot Info"), boost::dynamic_pointer_cast<FixedFormField>(payload->getFields()[1])->getValue()); + CPPUNIT_ASSERT_EQUAL(std::string("Section 1: Bot Info"), boost::dynamic_pointer_cast<FixedFormField>(payload->getFields()[1])->getValue()); - CPPUNIT_ASSERT_EQUAL(String("The name of your bot"), payload->getFields()[2]->getLabel()); + CPPUNIT_ASSERT_EQUAL(std::string("The name of your bot"), payload->getFields()[2]->getLabel()); - CPPUNIT_ASSERT_EQUAL(String("This is a bot.\nA quite good one actually"), boost::dynamic_pointer_cast<TextMultiFormField>(payload->getFields()[3])->getValue()); + CPPUNIT_ASSERT_EQUAL(std::string("This is a bot.\nA quite good one actually"), boost::dynamic_pointer_cast<TextMultiFormField>(payload->getFields()[3])->getValue()); CPPUNIT_ASSERT_EQUAL(true, boost::dynamic_pointer_cast<BooleanFormField>(payload->getFields()[4])->getValue()); CPPUNIT_ASSERT(payload->getFields()[4]->getRequired()); - CPPUNIT_ASSERT_EQUAL(String("1"), boost::dynamic_pointer_cast<BooleanFormField>(payload->getFields()[4])->getRawValues()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("1"), boost::dynamic_pointer_cast<BooleanFormField>(payload->getFields()[4])->getRawValues()[0]); - CPPUNIT_ASSERT_EQUAL(String("news"), boost::dynamic_pointer_cast<ListMultiFormField>(payload->getFields()[6])->getValue()[0]); - CPPUNIT_ASSERT_EQUAL(String("news"), payload->getFields()[6]->getRawValues()[0]); - CPPUNIT_ASSERT_EQUAL(String("search"), boost::dynamic_pointer_cast<ListMultiFormField>(payload->getFields()[6])->getValue()[1]); - CPPUNIT_ASSERT_EQUAL(String("search"), payload->getFields()[6]->getRawValues()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("news"), boost::dynamic_pointer_cast<ListMultiFormField>(payload->getFields()[6])->getValue()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("news"), payload->getFields()[6]->getRawValues()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("search"), boost::dynamic_pointer_cast<ListMultiFormField>(payload->getFields()[6])->getValue()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("search"), payload->getFields()[6]->getRawValues()[1]); CPPUNIT_ASSERT_EQUAL(5, static_cast<int>(payload->getFields()[6]->getOptions().size())); - CPPUNIT_ASSERT_EQUAL(String("Contests"), payload->getFields()[6]->getOptions()[0].label); - CPPUNIT_ASSERT_EQUAL(String("contests"), payload->getFields()[6]->getOptions()[0].value); - CPPUNIT_ASSERT_EQUAL(String("News"), payload->getFields()[6]->getOptions()[1].label); - CPPUNIT_ASSERT_EQUAL(String("news"), payload->getFields()[6]->getOptions()[1].value); + CPPUNIT_ASSERT_EQUAL(std::string("Contests"), payload->getFields()[6]->getOptions()[0].label); + CPPUNIT_ASSERT_EQUAL(std::string("contests"), payload->getFields()[6]->getOptions()[0].value); + CPPUNIT_ASSERT_EQUAL(std::string("News"), payload->getFields()[6]->getOptions()[1].label); + CPPUNIT_ASSERT_EQUAL(std::string("news"), payload->getFields()[6]->getOptions()[1].value); - CPPUNIT_ASSERT_EQUAL(String("20"), boost::dynamic_pointer_cast<ListSingleFormField>(payload->getFields()[7])->getValue()); + CPPUNIT_ASSERT_EQUAL(std::string("20"), boost::dynamic_pointer_cast<ListSingleFormField>(payload->getFields()[7])->getValue()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com"), boost::dynamic_pointer_cast<JIDMultiFormField>(payload->getFields()[8])->getValue()[0]); CPPUNIT_ASSERT_EQUAL(JID("baz@fum.org"), boost::dynamic_pointer_cast<JIDMultiFormField>(payload->getFields()[8])->getValue()[1]); - CPPUNIT_ASSERT_EQUAL(String("Tell all your friends about your new bot!"), payload->getFields()[8]->getDescription()); + CPPUNIT_ASSERT_EQUAL(std::string("Tell all your friends about your new bot!"), payload->getFields()[8]->getDescription()); - CPPUNIT_ASSERT_EQUAL(String("foo"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[0]); - CPPUNIT_ASSERT_EQUAL(String("baz"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("foo"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("baz"), boost::dynamic_pointer_cast<UntypedFormField>(payload->getFields()[9])->getValue()[1]); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h index ee64181..2c88955 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h +++ b/Swiften/Parser/PayloadParsers/UnitTest/PayloadsParserTester.h @@ -26,11 +26,11 @@ namespace Swift { delete xmlParser; } - bool parse(const String& data) { + bool parse(const std::string& data) { return xmlParser->parse(data); } - virtual void handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { + virtual void handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { if (level == 0) { CPPUNIT_ASSERT(!payloadParser.get()); PayloadParserFactory* payloadParserFactory = factories.getPayloadParserFactory(element, ns, attributes); @@ -41,12 +41,12 @@ namespace Swift { level++; } - virtual void handleEndElement(const String& element, const String& ns) { + virtual void handleEndElement(const std::string& element, const std::string& ns) { level--; payloadParser->handleEndElement(element, ns); } - virtual void handleCharacterData(const String& data) { + virtual void handleCharacterData(const std::string& data) { payloadParser->handleCharacterData(data); } diff --git a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp index 0fe58e0..867b25f 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/PrivateStorageParserTest.cpp @@ -40,7 +40,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(payload); boost::shared_ptr<Storage> storage = boost::dynamic_pointer_cast<Storage>(payload->getPayload()); CPPUNIT_ASSERT(storage); - CPPUNIT_ASSERT_EQUAL(String("Alice"), storage->getRooms()[0].nick); + CPPUNIT_ASSERT_EQUAL(std::string("Alice"), storage->getRooms()[0].nick); CPPUNIT_ASSERT_EQUAL(JID("swift@rooms.swift.im"), storage->getRooms()[0].jid); } @@ -75,7 +75,7 @@ class PrivateStorageParserTest : public CppUnit::TestFixture { CPPUNIT_ASSERT(payload); boost::shared_ptr<Storage> storage = boost::dynamic_pointer_cast<Storage>(payload->getPayload()); CPPUNIT_ASSERT(storage); - CPPUNIT_ASSERT_EQUAL(String("Rabbit"), storage->getRooms()[0].nick); + CPPUNIT_ASSERT_EQUAL(std::string("Rabbit"), storage->getRooms()[0].nick); } void testParse_UnsupportedPayload() { diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp index bb21f05..8885974 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/RawXMLPayloadParserTest.cpp @@ -25,7 +25,7 @@ class RawXMLPayloadParserTest : public CppUnit::TestFixture RawXMLPayloadParser testling; PayloadParserTester parser(&testling); - String xml = + std::string xml = "<foo foo-attr=\"foo-val\" xmlns=\"ns:foo\">" "<bar bar-attr=\"bar-val\" xmlns=\"ns:bar\"/>" "<baz baz-attr=\"baz-val\" xmlns=\"ns:baz\"/>" diff --git a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp index 18b194e..026ef2c 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/ResourceBindParserTest.cpp @@ -37,7 +37,7 @@ class ResourceBindParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><resource>someresource</resource></bind>")); ResourceBind* payload = dynamic_cast<ResourceBind*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("someresource"), payload->getResource()); + CPPUNIT_ASSERT_EQUAL(std::string("someresource"), payload->getResource()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp index b55a340..1bcea0e 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/RosterParserTest.cpp @@ -37,15 +37,15 @@ class RosterParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items.size()); CPPUNIT_ASSERT_EQUAL(JID("foo@bar.com"), items[0].getJID()); - CPPUNIT_ASSERT_EQUAL(String("Foo @ Bar"), items[0].getName()); + CPPUNIT_ASSERT_EQUAL(std::string("Foo @ Bar"), items[0].getName()); CPPUNIT_ASSERT_EQUAL(RosterItemPayload::From, items[0].getSubscription()); CPPUNIT_ASSERT(items[0].getSubscriptionRequested()); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(2), items[0].getGroups().size()); - CPPUNIT_ASSERT_EQUAL(String("Group 1"), items[0].getGroups()[0]); - CPPUNIT_ASSERT_EQUAL(String("Group 2"), items[0].getGroups()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("Group 1"), items[0].getGroups()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("Group 2"), items[0].getGroups()[1]); CPPUNIT_ASSERT_EQUAL(JID("baz@blo.com"), items[1].getJID()); - CPPUNIT_ASSERT_EQUAL(String("Baz"), items[1].getName()); + CPPUNIT_ASSERT_EQUAL(std::string("Baz"), items[1].getName()); CPPUNIT_ASSERT_EQUAL(RosterItemPayload::None, items[1].getSubscription()); CPPUNIT_ASSERT(!items[1].getSubscriptionRequested()); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(0), items[1].getGroups().size()); @@ -67,9 +67,9 @@ class RosterParserTest : public CppUnit::TestFixture const RosterPayload::RosterItemPayloads& items = payload->getItems(); CPPUNIT_ASSERT_EQUAL(static_cast<size_t>(1), items.size()); - CPPUNIT_ASSERT_EQUAL(String("Group 1"), items[0].getGroups()[0]); - CPPUNIT_ASSERT_EQUAL(String("Group 2"), items[0].getGroups()[1]); - CPPUNIT_ASSERT_EQUAL(String( + CPPUNIT_ASSERT_EQUAL(std::string("Group 1"), items[0].getGroups()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("Group 2"), items[0].getGroups()[1]); + CPPUNIT_ASSERT_EQUAL(std::string( "<foo xmlns=\"http://example.com\"><bar xmlns=\"http://example.com\">Baz</bar></foo>" "<baz xmlns=\"jabber:iq:roster\"><fum xmlns=\"jabber:iq:roster\">foo</fum></baz>" ), items[0].getUnknownContent()); diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp index 1d94c15..3d3bc7b 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/SearchPayloadParserTest.cpp @@ -31,7 +31,7 @@ class SearchPayloadParserTest : public CppUnit::TestFixture { )); SearchPayload::ref payload = parser.getPayload<SearchPayload>(); - CPPUNIT_ASSERT_EQUAL(String("Foo"), *payload->getInstructions()); + CPPUNIT_ASSERT_EQUAL(std::string("Foo"), *payload->getInstructions()); CPPUNIT_ASSERT(payload->getFirst()); CPPUNIT_ASSERT(payload->getLast()); CPPUNIT_ASSERT(!payload->getNick()); @@ -60,10 +60,10 @@ class SearchPayloadParserTest : public CppUnit::TestFixture { SearchPayload::ref payload = parser.getPayload<SearchPayload>(); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getItems().size())); CPPUNIT_ASSERT_EQUAL(JID("juliet@capulet.com"), payload->getItems()[0].jid); - CPPUNIT_ASSERT_EQUAL(String("Juliet"), payload->getItems()[0].first); - CPPUNIT_ASSERT_EQUAL(String("Capulet"), payload->getItems()[0].last); - CPPUNIT_ASSERT_EQUAL(String("JuliC"), payload->getItems()[0].nick); - CPPUNIT_ASSERT_EQUAL(String("juliet@shakespeare.lit"), payload->getItems()[0].email); + CPPUNIT_ASSERT_EQUAL(std::string("Juliet"), payload->getItems()[0].first); + CPPUNIT_ASSERT_EQUAL(std::string("Capulet"), payload->getItems()[0].last); + CPPUNIT_ASSERT_EQUAL(std::string("JuliC"), payload->getItems()[0].nick); + CPPUNIT_ASSERT_EQUAL(std::string("juliet@shakespeare.lit"), payload->getItems()[0].email); CPPUNIT_ASSERT_EQUAL(JID("tybalt@shakespeare.lit"), payload->getItems()[1].jid); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp index 9891330..0812c6b 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelParserTest.cpp @@ -39,12 +39,12 @@ class SecurityLabelParserTest : public CppUnit::TestFixture "</securitylabel>")); SecurityLabel* payload = dynamic_cast<SecurityLabel*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("SECRET"), payload->getDisplayMarking()); - CPPUNIT_ASSERT_EQUAL(String("black"), payload->getForegroundColor()); - CPPUNIT_ASSERT_EQUAL(String("red"), payload->getBackgroundColor()); - CPPUNIT_ASSERT_EQUAL(String("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQYCAQQGASk=</esssecuritylabel>"), payload->getLabel()); - CPPUNIT_ASSERT_EQUAL(String("<icismlabel classification=\"S\" disseminationControls=\"FOUO\" ownerProducer=\"USA\" xmlns=\"http://example.gov/IC-ISM/0\"/>"), payload->getEquivalentLabels()[0]); - CPPUNIT_ASSERT_EQUAL(String("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MRUCAgD9DA9BcXVhIChvYnNvbGV0ZSk=</esssecuritylabel>"), payload->getEquivalentLabels()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("SECRET"), payload->getDisplayMarking()); + CPPUNIT_ASSERT_EQUAL(std::string("black"), payload->getForegroundColor()); + CPPUNIT_ASSERT_EQUAL(std::string("red"), payload->getBackgroundColor()); + CPPUNIT_ASSERT_EQUAL(std::string("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQYCAQQGASk=</esssecuritylabel>"), payload->getLabel()); + CPPUNIT_ASSERT_EQUAL(std::string("<icismlabel classification=\"S\" disseminationControls=\"FOUO\" ownerProducer=\"USA\" xmlns=\"http://example.gov/IC-ISM/0\"/>"), payload->getEquivalentLabels()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MRUCAgD9DA9BcXVhIChvYnNvbGV0ZSk=</esssecuritylabel>"), payload->getEquivalentLabels()[1]); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp index b9eedb3..9925e34 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/SecurityLabelsCatalogParserTest.cpp @@ -37,14 +37,14 @@ class SecurityLabelsCatalogParserTest : public CppUnit::TestFixture "</catalog>")); SecurityLabelsCatalog* payload = dynamic_cast<SecurityLabelsCatalog*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("Default"), payload->getName()); - CPPUNIT_ASSERT_EQUAL(String("an example set of labels"), payload->getDescription()); + CPPUNIT_ASSERT_EQUAL(std::string("Default"), payload->getName()); + CPPUNIT_ASSERT_EQUAL(std::string("an example set of labels"), payload->getDescription()); CPPUNIT_ASSERT_EQUAL(JID("example.com"), payload->getTo()); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getLabels().size())); - CPPUNIT_ASSERT_EQUAL(String("SECRET"), payload->getLabels()[0].getDisplayMarking()); - CPPUNIT_ASSERT_EQUAL(String("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQYCAQQGASk=</esssecuritylabel>"), payload->getLabels()[0].getLabel()); - CPPUNIT_ASSERT_EQUAL(String("CONFIDENTIAL"), payload->getLabels()[1].getDisplayMarking()); - CPPUNIT_ASSERT_EQUAL(String("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQMGASk=</esssecuritylabel>"), payload->getLabels()[1].getLabel()); + CPPUNIT_ASSERT_EQUAL(std::string("SECRET"), payload->getLabels()[0].getDisplayMarking()); + CPPUNIT_ASSERT_EQUAL(std::string("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQYCAQQGASk=</esssecuritylabel>"), payload->getLabels()[0].getLabel()); + CPPUNIT_ASSERT_EQUAL(std::string("CONFIDENTIAL"), payload->getLabels()[1].getDisplayMarking()); + CPPUNIT_ASSERT_EQUAL(std::string("<esssecuritylabel xmlns=\"urn:xmpp:sec-label:ess:0\">MQMGASk=</esssecuritylabel>"), payload->getLabels()[1].getLabel()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp index ae1bbb6..3689f10 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/SoftwareVersionParserTest.cpp @@ -32,9 +32,9 @@ class SoftwareVersionParserTest : public CppUnit::TestFixture "</query>")); SoftwareVersion* payload = dynamic_cast<SoftwareVersion*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("myclient"), payload->getName()); - CPPUNIT_ASSERT_EQUAL(String("1.0"), payload->getVersion()); - CPPUNIT_ASSERT_EQUAL(String("Mac OS X"), payload->getOS()); + CPPUNIT_ASSERT_EQUAL(std::string("myclient"), payload->getName()); + CPPUNIT_ASSERT_EQUAL(std::string("1.0"), payload->getVersion()); + CPPUNIT_ASSERT_EQUAL(std::string("Mac OS X"), payload->getOS()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp index a0d3ae7..7791f5f 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/StatusParserTest.cpp @@ -27,7 +27,7 @@ class StatusParserTest : public CppUnit::TestFixture CPPUNIT_ASSERT(parser.parse("<status>foo<baz>bar</baz>fum</status>")); Status* payload = dynamic_cast<Status*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("foobarfum"), payload->getText()); + CPPUNIT_ASSERT_EQUAL(std::string("foobarfum"), payload->getText()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp index cad3b5c..88730b7 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/StorageParserTest.cpp @@ -38,11 +38,11 @@ class StorageParserTest : public CppUnit::TestFixture { Storage* payload = dynamic_cast<Storage*>(parser.getPayload().get()); std::vector<Storage::Room> rooms = payload->getRooms(); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(rooms.size())); - CPPUNIT_ASSERT_EQUAL(String("Council of Oberon"), rooms[0].name); + CPPUNIT_ASSERT_EQUAL(std::string("Council of Oberon"), rooms[0].name); CPPUNIT_ASSERT_EQUAL(JID("council@conference.underhill.org"), rooms[0].jid); CPPUNIT_ASSERT(rooms[0].autoJoin); - CPPUNIT_ASSERT_EQUAL(String("Puck"), rooms[0].nick); - CPPUNIT_ASSERT_EQUAL(String("MyPass"), rooms[0].password); + CPPUNIT_ASSERT_EQUAL(std::string("Puck"), rooms[0].nick); + CPPUNIT_ASSERT_EQUAL(std::string("MyPass"), rooms[0].password); } void testParse_MultipleRooms() { @@ -61,9 +61,9 @@ class StorageParserTest : public CppUnit::TestFixture { Storage* payload = dynamic_cast<Storage*>(parser.getPayload().get()); std::vector<Storage::Room> rooms = payload->getRooms(); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(rooms.size())); - CPPUNIT_ASSERT_EQUAL(String("Council of Oberon"), rooms[0].name); + CPPUNIT_ASSERT_EQUAL(std::string("Council of Oberon"), rooms[0].name); CPPUNIT_ASSERT_EQUAL(JID("council@conference.underhill.org"), rooms[0].jid); - CPPUNIT_ASSERT_EQUAL(String("Tea party"), rooms[1].name); + CPPUNIT_ASSERT_EQUAL(std::string("Tea party"), rooms[1].name); CPPUNIT_ASSERT_EQUAL(JID("teaparty@wonderland.lit"), rooms[1].jid); } @@ -78,8 +78,8 @@ class StorageParserTest : public CppUnit::TestFixture { Storage* payload = dynamic_cast<Storage*>(parser.getPayload().get()); std::vector<Storage::URL> urls = payload->getURLs(); CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(urls.size())); - CPPUNIT_ASSERT_EQUAL(String("Complete Works of Shakespeare"), urls[0].name); - CPPUNIT_ASSERT_EQUAL(String("http://the-tech.mit.edu/Shakespeare/"), urls[0].url); + CPPUNIT_ASSERT_EQUAL(std::string("Complete Works of Shakespeare"), urls[0].name); + CPPUNIT_ASSERT_EQUAL(std::string("http://the-tech.mit.edu/Shakespeare/"), urls[0].url); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp index ca8e353..8001487 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/StreamInitiationParserTest.cpp @@ -42,13 +42,13 @@ class StreamInitiationParserTest : public CppUnit::TestFixture { StreamInitiation::ref si = parser.getPayload<StreamInitiation>(); CPPUNIT_ASSERT(si->getIsFileTransfer()); CPPUNIT_ASSERT(si->getFileInfo()); - CPPUNIT_ASSERT_EQUAL(String("test.txt"), si->getFileInfo()->name); + CPPUNIT_ASSERT_EQUAL(std::string("test.txt"), si->getFileInfo()->name); CPPUNIT_ASSERT_EQUAL(1022, si->getFileInfo()->size); - CPPUNIT_ASSERT_EQUAL(String("This is info about the file."), si->getFileInfo()->description); + CPPUNIT_ASSERT_EQUAL(std::string("This is info about the file."), si->getFileInfo()->description); CPPUNIT_ASSERT_EQUAL(3, static_cast<int>(si->getProvidedMethods().size())); - CPPUNIT_ASSERT_EQUAL(String("http://jabber.org/protocol/bytestreams"), si->getProvidedMethods()[0]); - CPPUNIT_ASSERT_EQUAL(String("jabber:iq:oob"), si->getProvidedMethods()[1]); - CPPUNIT_ASSERT_EQUAL(String("http://jabber.org/protocol/ibb"), si->getProvidedMethods()[2]); + CPPUNIT_ASSERT_EQUAL(std::string("http://jabber.org/protocol/bytestreams"), si->getProvidedMethods()[0]); + CPPUNIT_ASSERT_EQUAL(std::string("jabber:iq:oob"), si->getProvidedMethods()[1]); + CPPUNIT_ASSERT_EQUAL(std::string("http://jabber.org/protocol/ibb"), si->getProvidedMethods()[2]); } void testParse_Response() { @@ -68,7 +68,7 @@ class StreamInitiationParserTest : public CppUnit::TestFixture { StreamInitiation::ref si = parser.getPayload<StreamInitiation>(); CPPUNIT_ASSERT(si->getIsFileTransfer()); - CPPUNIT_ASSERT_EQUAL(String("http://jabber.org/protocol/bytestreams"), si->getRequestedMethod()); + CPPUNIT_ASSERT_EQUAL(std::string("http://jabber.org/protocol/bytestreams"), si->getRequestedMethod()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp index aed04bc..909401d 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardParserTest.cpp @@ -53,23 +53,23 @@ class VCardParserTest : public CppUnit::TestFixture { "</vCard>")); boost::shared_ptr<VCard> payload = boost::dynamic_pointer_cast<VCard>(parser.getPayload()); - CPPUNIT_ASSERT_EQUAL(String("2.0"), payload->getVersion()); - CPPUNIT_ASSERT_EQUAL(String("Alice In Wonderland"), payload->getFullName()); - CPPUNIT_ASSERT_EQUAL(String("Alice"), payload->getGivenName()); - CPPUNIT_ASSERT_EQUAL(String("In"), payload->getMiddleName()); - CPPUNIT_ASSERT_EQUAL(String("Wonderland"), payload->getFamilyName()); - CPPUNIT_ASSERT_EQUAL(String("Mrs"), payload->getPrefix()); - CPPUNIT_ASSERT_EQUAL(String("PhD"), payload->getSuffix()); - CPPUNIT_ASSERT_EQUAL(String("DreamGirl"), payload->getNickname()); - CPPUNIT_ASSERT_EQUAL(String("<BDAY xmlns=\"vcard-temp\">1234</BDAY><MAILER xmlns=\"vcard-temp\">mutt</MAILER>"), payload->getUnknownContent()); + CPPUNIT_ASSERT_EQUAL(std::string("2.0"), payload->getVersion()); + CPPUNIT_ASSERT_EQUAL(std::string("Alice In Wonderland"), payload->getFullName()); + CPPUNIT_ASSERT_EQUAL(std::string("Alice"), payload->getGivenName()); + CPPUNIT_ASSERT_EQUAL(std::string("In"), payload->getMiddleName()); + CPPUNIT_ASSERT_EQUAL(std::string("Wonderland"), payload->getFamilyName()); + CPPUNIT_ASSERT_EQUAL(std::string("Mrs"), payload->getPrefix()); + CPPUNIT_ASSERT_EQUAL(std::string("PhD"), payload->getSuffix()); + CPPUNIT_ASSERT_EQUAL(std::string("DreamGirl"), payload->getNickname()); + CPPUNIT_ASSERT_EQUAL(std::string("<BDAY xmlns=\"vcard-temp\">1234</BDAY><MAILER xmlns=\"vcard-temp\">mutt</MAILER>"), payload->getUnknownContent()); CPPUNIT_ASSERT_EQUAL(2, static_cast<int>(payload->getEMailAddresses().size())); - CPPUNIT_ASSERT_EQUAL(String("alice@wonderland.lit"), payload->getEMailAddresses()[0].address); + CPPUNIT_ASSERT_EQUAL(std::string("alice@wonderland.lit"), payload->getEMailAddresses()[0].address); CPPUNIT_ASSERT(payload->getEMailAddresses()[0].isHome); CPPUNIT_ASSERT(payload->getEMailAddresses()[0].isInternet); CPPUNIT_ASSERT(payload->getEMailAddresses()[0].isPreferred); CPPUNIT_ASSERT(!payload->getEMailAddresses()[0].isWork); CPPUNIT_ASSERT(!payload->getEMailAddresses()[0].isX400); - CPPUNIT_ASSERT_EQUAL(String("alice@teaparty.lit"), payload->getEMailAddresses()[1].address); + CPPUNIT_ASSERT_EQUAL(std::string("alice@teaparty.lit"), payload->getEMailAddresses()[1].address); CPPUNIT_ASSERT(!payload->getEMailAddresses()[1].isHome); CPPUNIT_ASSERT(!payload->getEMailAddresses()[1].isInternet); CPPUNIT_ASSERT(!payload->getEMailAddresses()[1].isPreferred); @@ -92,7 +92,7 @@ class VCardParserTest : public CppUnit::TestFixture { "</vCard>")); VCard* payload = dynamic_cast<VCard*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("image/jpeg"), payload->getPhotoType()); + CPPUNIT_ASSERT_EQUAL(std::string("image/jpeg"), payload->getPhotoType()); CPPUNIT_ASSERT_EQUAL(ByteArray("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890"), payload->getPhoto()); } @@ -105,7 +105,7 @@ class VCardParserTest : public CppUnit::TestFixture { "</vCard>")); VCard* payload = dynamic_cast<VCard*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("mynick"), payload->getNickname()); + CPPUNIT_ASSERT_EQUAL(std::string("mynick"), payload->getNickname()); } }; diff --git a/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp b/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp index 79df412..b8ea4fb 100644 --- a/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp +++ b/Swiften/Parser/PayloadParsers/UnitTest/VCardUpdateParserTest.cpp @@ -30,7 +30,7 @@ class VCardUpdateParserTest : public CppUnit::TestFixture "</x>")); VCardUpdate* payload = dynamic_cast<VCardUpdate*>(parser.getPayload().get()); - CPPUNIT_ASSERT_EQUAL(String("sha1-hash-of-image"), payload->getPhotoHash()); + CPPUNIT_ASSERT_EQUAL(std::string("sha1-hash-of-image"), payload->getPhotoHash()); } }; diff --git a/Swiften/Parser/PayloadParsers/VCardParser.cpp b/Swiften/Parser/PayloadParsers/VCardParser.cpp index 2f1f8dc..61af0ba 100644 --- a/Swiften/Parser/PayloadParsers/VCardParser.cpp +++ b/Swiften/Parser/PayloadParsers/VCardParser.cpp @@ -14,9 +14,9 @@ namespace Swift { VCardParser::VCardParser() : unknownContentParser_(NULL) { } -void VCardParser::handleStartElement(const String& element, const String& ns, const AttributeMap& attributes) { +void VCardParser::handleStartElement(const std::string& element, const std::string& ns, const AttributeMap& attributes) { elementStack_.push_back(element); - String elementHierarchy = getElementHierarchy(); + std::string elementHierarchy = getElementHierarchy(); if (elementHierarchy == "/vCard/EMAIL") { currentEMailAddress_ = VCard::EMailAddress(); } @@ -32,12 +32,12 @@ void VCardParser::handleStartElement(const String& element, const String& ns, co currentText_ = ""; } -void VCardParser::handleEndElement(const String& element, const String& ns) { +void VCardParser::handleEndElement(const std::string& element, const std::string& ns) { if (unknownContentParser_) { unknownContentParser_->handleEndElement(element, ns); } - String elementHierarchy = getElementHierarchy(); + std::string elementHierarchy = getElementHierarchy(); if (elementHierarchy == "/vCard/VERSION") { getPayloadInternal()->setVersion(currentText_); } @@ -104,16 +104,16 @@ void VCardParser::handleEndElement(const String& element, const String& ns) { elementStack_.pop_back(); } -void VCardParser::handleCharacterData(const String& text) { +void VCardParser::handleCharacterData(const std::string& text) { if (unknownContentParser_) { unknownContentParser_->handleCharacterData(text); } currentText_ += text; } -String VCardParser::getElementHierarchy() const { - String result; - foreach(const String& element, elementStack_) { +std::string VCardParser::getElementHierarchy() const { + std::string result; + foreach(const std::string& element, elementStack_) { result += "/" + element; } return result; diff --git a/Swiften/Parser/PayloadParsers/VCardParser.h b/Swiften/Parser/PayloadParsers/VCardParser.h index f912ff1..c858e61 100644 --- a/Swiften/Parser/PayloadParsers/VCardParser.h +++ b/Swiften/Parser/PayloadParsers/VCardParser.h @@ -16,17 +16,17 @@ namespace Swift { public: VCardParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: - String getElementHierarchy() const; + std::string getElementHierarchy() const; private: - std::vector<String> elementStack_; + std::vector<std::string> elementStack_; VCard::EMailAddress currentEMailAddress_; SerializingParser* unknownContentParser_; - String currentText_; + std::string currentText_; }; } diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp b/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp index 08d2d35..2218d75 100644 --- a/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp +++ b/Swiften/Parser/PayloadParsers/VCardUpdateParser.cpp @@ -11,21 +11,21 @@ namespace Swift { VCardUpdateParser::VCardUpdateParser() : level_(TopLevel) { } -void VCardUpdateParser::handleStartElement(const String&, const String&, const AttributeMap&) { +void VCardUpdateParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { if (level_ == PayloadLevel) { currentText_ = ""; } ++level_; } -void VCardUpdateParser::handleEndElement(const String& element, const String&) { +void VCardUpdateParser::handleEndElement(const std::string& element, const std::string&) { --level_; if (level_ == PayloadLevel && element == "photo") { getPayloadInternal()->setPhotoHash(currentText_); } } -void VCardUpdateParser::handleCharacterData(const String& text) { +void VCardUpdateParser::handleCharacterData(const std::string& text) { currentText_ += text; } diff --git a/Swiften/Parser/PayloadParsers/VCardUpdateParser.h b/Swiften/Parser/PayloadParsers/VCardUpdateParser.h index df86123..b91c17b 100644 --- a/Swiften/Parser/PayloadParsers/VCardUpdateParser.h +++ b/Swiften/Parser/PayloadParsers/VCardUpdateParser.h @@ -16,9 +16,9 @@ namespace Swift { public: VCardUpdateParser(); - virtual void handleStartElement(const String& element, const String&, const AttributeMap& attributes); - virtual void handleEndElement(const String& element, const String&); - virtual void handleCharacterData(const String& data); + virtual void handleStartElement(const std::string& element, const std::string&, const AttributeMap& attributes); + virtual void handleEndElement(const std::string& element, const std::string&); + virtual void handleCharacterData(const std::string& data); private: enum Level { @@ -26,6 +26,6 @@ namespace Swift { PayloadLevel = 1 }; int level_; - String currentText_; + std::string currentText_; }; } |