diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-04-09 15:41:35 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-04-18 19:11:41 (GMT) |
commit | 83f360b98d28e3a34dcabce170e1e4d9577e50d3 (patch) | |
tree | 5f61f628f409d1dbe6388901c9efa20182ebaed3 /Swiften/Base | |
parent | 40587e704a2a8dfe7d29cc2e28e140f01c9f86bc (diff) | |
download | swift-contrib-83f360b98d28e3a34dcabce170e1e4d9577e50d3.zip swift-contrib-83f360b98d28e3a34dcabce170e1e4d9577e50d3.tar.bz2 |
Fixed tests on windows.
Diffstat (limited to 'Swiften/Base')
-rw-r--r-- | Swiften/Base/ByteArray.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h index 9e7a928..d55da1f 100644 --- a/Swiften/Base/ByteArray.h +++ b/Swiften/Base/ByteArray.h @@ -139,6 +139,14 @@ namespace Swift { static std::vector<unsigned char> create(const unsigned char* c, size_t n); static std::vector<unsigned char> create(const char* c, size_t n); + static const unsigned char* data(const std::vector<unsigned char>& v) { + return v.empty() ? NULL : &v[0]; + } + + static const char* charData(const std::vector<unsigned char>& v) { + return v.empty() ? NULL : reinterpret_cast<const char*>(&v[0]); + } + private: std::vector<unsigned char> data_; }; |