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-12-26 21:36:29 +0100
commit20923d40f1894e635b31a9bb99a78f61a8696876 (patch)
treecdf32a4c9be9834dbd8677a4bace862a9460f699 /src/KM_util.h
parent9af0fb9e18d1d5285ad3b3aff28721eb0708a395 (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);