diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:22:06 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-05-18 16:50:18 (GMT) |
commit | 8472194d716e0e3b95a66bf5be45c246ee79d0af (patch) | |
tree | b9f473e0e606b012ee5013e85d2cf5e7523b7029 /Swiften/Base | |
parent | b1b3b8f88517ad8b14795cc8a6265962d2935be3 (diff) | |
download | swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.zip swift-contrib-8472194d716e0e3b95a66bf5be45c246ee79d0af.tar.bz2 |
Propagate use of SafeByteArray down to the connection.
Diffstat (limited to 'Swiften/Base')
-rw-r--r-- | Swiften/Base/SafeByteArray.h | 4 | ||||
-rw-r--r-- | Swiften/Base/SafeString.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Base/SafeByteArray.h b/Swiften/Base/SafeByteArray.h index c80a2c0..1ef850f 100644 --- a/Swiften/Base/SafeByteArray.h +++ b/Swiften/Base/SafeByteArray.h @@ -34,6 +34,10 @@ namespace Swift { return SafeByteArray(c, c + n); } + inline SafeByteArray createSafeByteArray(const unsigned char* c, size_t n) { + return SafeByteArray(c, c + n); + } + SafeByteArray createSafeByteArray(const SafeString& s); } diff --git a/Swiften/Base/SafeString.h b/Swiften/Base/SafeString.h index 0bd898d..44b0316 100644 --- a/Swiften/Base/SafeString.h +++ b/Swiften/Base/SafeString.h @@ -59,6 +59,10 @@ namespace Swift { return data.size(); } + bool operator==(const SafeString& o) const { + return data == o.data; + } + private: std::vector<char, SafeAllocator<char> > data; }; |