summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-05-23 19:09:49 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-05-23 19:09:49 (GMT)
commit4e05484ab2475cd50572a81e831235f916e8b7ba (patch)
tree7414fdb091254a826d0e4054fa2a5fe66e995e49 /Swiften/JID
parent4681af4be3dd8722b2b23515c315e5bad9193c58 (diff)
downloadswift-contrib-4e05484ab2475cd50572a81e831235f916e8b7ba.zip
swift-contrib-4e05484ab2475cd50572a81e831235f916e8b7ba.tar.bz2
Added makeString().
Diffstat (limited to 'Swiften/JID')
-rw-r--r--Swiften/JID/JID.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/Swiften/JID/JID.cpp b/Swiften/JID/JID.cpp
index 9fa0574..2ebbdd6 100644
--- a/Swiften/JID/JID.cpp
+++ b/Swiften/JID/JID.cpp
@@ -24,6 +24,8 @@
#include <Swiften/JID/JID.h>
#include <Swiften/IDN/StringPrep.h>
+using namespace Swift;
+
#ifdef SWIFTEN_CACHE_JID_PREP
typedef boost::unordered_map<std::string, std::string> PrepCache;
@@ -35,9 +37,7 @@ static PrepCache resourcePrepCache;
static const std::list<char> escapedChars = boost::assign::list_of(' ')('"')('&')('\'')('/')('<')('>')('@')(':');
static std::string getEscaped(char c) {
- std::ostringstream s;
- s << '\\' << std::hex << static_cast<int>(c);
- return s.str();
+ return makeString() << '\\' << std::hex << static_cast<int>(c);
}
static bool getEscapeSequenceValue(const std::string& sequence, unsigned char& value) {
@@ -110,8 +110,6 @@ struct EscapedCharacterFormatter {
};
#endif
-using namespace Swift;
-
JID::JID(const char* jid) {
initializeFromString(std::string(jid));
}