summaryrefslogtreecommitdiff
path: root/src/KM_util.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-06 20:22:23 +0200
committerCarl Hetherington <cth@carlh.net>2020-07-11 01:28:41 +0200
commit656e22f15d25fbdfd071047c87493a5a148eda6c (patch)
tree70debb64cfba8dc6bb52aee920683a9e285d4a1a /src/KM_util.h
parent31ace7591005675b514cc534762f91e576c69424 (diff)
Move copy construction of Raw up to ByteString to fix warning when Raw(Raw&) does not call its parent class.
Diffstat (limited to 'src/KM_util.h')
-rwxr-xr-xsrc/KM_util.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/KM_util.h b/src/KM_util.h
index f6a8935..9dcf846 100755
--- a/src/KM_util.h
+++ b/src/KM_util.h
@@ -512,8 +512,6 @@ namespace Kumu
//
class ByteString : public IArchive
{
- KM_NO_COPY_CONSTRUCT(ByteString);
-
protected:
byte_t* m_Data; // pointer to memory area containing frame data
ui32_t m_Capacity; // size of memory area pointed to by m_Data
@@ -521,9 +519,19 @@ namespace Kumu
public:
ByteString();
+ ByteString(const ByteString& rhs) { Copy(rhs); }
ByteString(ui32_t cap);
virtual ~ByteString();
+ const ByteString& operator=(const ByteString& rhs) { Copy(rhs); return *this; }
+
+ void Copy(const ByteString& rhs) {
+ if ( KM_SUCCESS(Capacity(rhs.Length())) )
+ {
+ Set(rhs);
+ }
+ }
+
// Sets or resets the size of the internally allocated buffer.
Result_t Capacity(ui32_t cap);