summaryrefslogtreecommitdiff
path: root/src/KM_util.cpp
diff options
context:
space:
mode:
authorjhurst <jhurst@cinecert.com>2007-03-03 20:29:25 +0000
committerjhurst <>2007-03-03 20:29:25 +0000
commit49e1347e14c2ea6ee69d7f879d2d05448da50403 (patch)
tree29fe28eb1a9353f4c6a394bf656a9178963db922 /src/KM_util.cpp
parentd3fc58a004ab9ae9bbbb1ac7174fa00465563a90 (diff)
added new methods
Diffstat (limited to 'src/KM_util.cpp')
-rwxr-xr-xsrc/KM_util.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/KM_util.cpp b/src/KM_util.cpp
index 1d2cc11..8228739 100755
--- a/src/KM_util.cpp
+++ b/src/KM_util.cpp
@@ -1026,6 +1026,20 @@ Kumu::ByteString::Set(const byte_t* buf, ui32_t buf_len)
}
+// copy the given data into the ByteString, set Length value.
+// Returns error if the ByteString is too small.
+Kumu::Result_t
+Kumu::ByteString::Set(const ByteString& Buf)
+{
+ if ( m_Capacity < Buf.m_Capacity )
+ return RESULT_ALLOC;
+
+ memcpy(m_Data, Buf.m_Data, Buf.m_Length);
+ m_Length = Buf.m_Length;
+ return RESULT_OK;
+}
+
+
// Sets the size of the internally allocate buffer.
// Resets content length to zero.
Kumu::Result_t