aboutsummaryrefslogtreecommitdiffstats
path: root/src/Buffer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-06 11:35:35 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-06 11:35:35 +0100
commit3633bcc99aedda5d9ea36c143fa339139c763d3e (patch)
tree6c296bee8cfb6aabb292fe6fc040708c7e4d2e7a /src/Buffer.cpp
parent67c82c97dfcfc68d4bd71f5773d21c34c8733c83 (diff)
downloaddabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.tar.gz
dabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.tar.bz2
dabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.zip
Replace EDI-to-ETI converter with a dedicated EDI source
Diffstat (limited to 'src/Buffer.cpp')
-rw-r--r--src/Buffer.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index fa7f52f..8631c42 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -2,6 +2,11 @@
Copyright (C) 2011
Her Majesty the Queen in Right of Canada (Communications Research
Center Canada)
+
+ Copyright (C) 2016
+ Matthias P. Braendli, matthias.braendli@mpb.li
+
+ http://opendigitalradio.org
*/
/*
This file is part of ODR-DabMod.
@@ -44,6 +49,16 @@ Buffer::Buffer(size_t len, const void *data)
setData(data, len);
}
+Buffer::Buffer(const std::vector<uint8_t> &vec)
+{
+ PDEBUG("Buffer::Buffer(vector [%zu])\n", vec.size());
+
+ this->len = 0;
+ this->size = 0;
+ this->data = NULL;
+ setData(vec.data(), vec.size());
+}
+
Buffer::~Buffer()
{
@@ -58,6 +73,11 @@ Buffer &Buffer::operator=(const Buffer &copy)
return *this;
}
+Buffer &Buffer::operator=(const std::vector<uint8_t> &copy)
+{
+ setData(copy.data(), copy.size());
+ return *this;
+}
Buffer &Buffer::operator+=(const Buffer &copy)
{