diff options
Diffstat (limited to 'Swiften/Parser/PayloadParsers/UserTuneParser.cpp')
-rw-r--r-- | Swiften/Parser/PayloadParsers/UserTuneParser.cpp | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/Swiften/Parser/PayloadParsers/UserTuneParser.cpp b/Swiften/Parser/PayloadParsers/UserTuneParser.cpp index f3f42ef..f030f8f 100644 --- a/Swiften/Parser/PayloadParsers/UserTuneParser.cpp +++ b/Swiften/Parser/PayloadParsers/UserTuneParser.cpp @@ -17,43 +17,43 @@ UserTuneParser::~UserTuneParser() { } void UserTuneParser::handleStartElement(const std::string&, const std::string&, const AttributeMap&) { - if (level == 1) { - currentText = ""; - } - ++level; + if (level == 1) { + currentText = ""; + } + ++level; } void UserTuneParser::handleEndElement(const std::string& element, const std::string&) { - --level; - if (level == 1) { - try { - if (element == "artist") { - getPayloadInternal()->setArtist(currentText); - } - else if (element == "length") { - getPayloadInternal()->setLength(boost::lexical_cast<unsigned int>(currentText)); - } - else if (element == "rating") { - getPayloadInternal()->setRating(boost::lexical_cast<unsigned int>(currentText)); - } - else if (element == "source") { - getPayloadInternal()->setSource(currentText); - } - else if (element == "title") { - getPayloadInternal()->setTitle(currentText); - } - else if (element == "track") { - getPayloadInternal()->setTrack(currentText); - } - else if (element == "URI") { - getPayloadInternal()->setURI(currentText); - } - } - catch (const boost::bad_lexical_cast&) { - } - } + --level; + if (level == 1) { + try { + if (element == "artist") { + getPayloadInternal()->setArtist(currentText); + } + else if (element == "length") { + getPayloadInternal()->setLength(boost::lexical_cast<unsigned int>(currentText)); + } + else if (element == "rating") { + getPayloadInternal()->setRating(boost::lexical_cast<unsigned int>(currentText)); + } + else if (element == "source") { + getPayloadInternal()->setSource(currentText); + } + else if (element == "title") { + getPayloadInternal()->setTitle(currentText); + } + else if (element == "track") { + getPayloadInternal()->setTrack(currentText); + } + else if (element == "URI") { + getPayloadInternal()->setURI(currentText); + } + } + catch (const boost::bad_lexical_cast&) { + } + } } void UserTuneParser::handleCharacterData(const std::string& data) { - currentText += data; + currentText += data; } |