diff options
Diffstat (limited to 'Swiften/Base/ByteArray.h')
-rw-r--r-- | Swiften/Base/ByteArray.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h index 8ef8dd6..b368ef8 100644 --- a/Swiften/Base/ByteArray.h +++ b/Swiften/Base/ByteArray.h @@ -12,16 +12,21 @@ namespace Swift { typedef std::vector<unsigned char> ByteArray; - ByteArray createByteArray(const unsigned char* c, size_t n); ByteArray createByteArray(const std::string& s); ByteArray createByteArray(const char* c); - ByteArray createByteArray(const char* c, size_t n); + + inline ByteArray createByteArray(const unsigned char* c, size_t n) { + return ByteArray(c, c + n); + } + + inline ByteArray createByteArray(const char* c, size_t n) { + return ByteArray(c, c + n); + } inline ByteArray createByteArray(char c) { return std::vector<unsigned char>(1, c); } - template<typename T, typename A> static const T* vecptr(const std::vector<T, A>& v) { return v.empty() ? NULL : &v[0]; |