summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften')
-rw-r--r--Swiften/Base/ByteArray.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Swiften/Base/ByteArray.h b/Swiften/Base/ByteArray.h
index 26adedc..ad2c1e5 100644
--- a/Swiften/Base/ByteArray.h
+++ b/Swiften/Base/ByteArray.h
@@ -43,6 +43,9 @@ namespace Swift {
}
}
+ ByteArray(const std::vector<unsigned char>& data) : data_(data) {
+ }
+
const unsigned char* getData() const {
return data_.empty() ? NULL : &data_[0];
}
@@ -50,6 +53,14 @@ namespace Swift {
unsigned char* getData() {
return data_.empty() ? NULL : &data_[0];
}
+
+ const std::vector<unsigned char>& getVector() const {
+ return data_;
+ }
+
+ std::vector<unsigned char>& getVector() {
+ return data_;
+ }
size_t getSize() const {
return data_.size();