aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/blob.cpp
diff options
context:
space:
mode:
authorMike Buland <mbuland@penny-arcade.com>2022-04-20 14:04:47 -0700
committerMike Buland <mbuland@penny-arcade.com>2022-04-20 14:04:47 -0700
commitfd56cdd21a7c9c944ad189cf91ff24d3c2b0f975 (patch)
treef16f7e7f54399ef9c753beb87069eed8122dbccb /src/unstable/blob.cpp
parentd10e6a5ca0905f0ef2836cd98aebfb48e7f1e8a3 (diff)
downloadlibbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.gz
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.bz2
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.tar.xz
libbu++-fd56cdd21a7c9c944ad189cf91ff24d3c2b0f975.zip
Gradually moving to better archive structure.
It's dragging other new API changes along with it, including use of Blob and Text.
Diffstat (limited to 'src/unstable/blob.cpp')
-rw-r--r--src/unstable/blob.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/unstable/blob.cpp b/src/unstable/blob.cpp
index e72e265..51e74ff 100644
--- a/src/unstable/blob.cpp
+++ b/src/unstable/blob.cpp
@@ -142,6 +142,26 @@ bool Bu::Blob::isNullOrEmpty() const
142 return pData == NULL || iSize == 0; 142 return pData == NULL || iSize == 0;
143} 143}
144 144
145void Bu::Blob::set( const Blob &rRhs )
146{
147 *this = rRhs;
148}
149
150void Bu::Blob::set( const char *pRhs )
151{
152 *this = pRhs;
153}
154
155void Bu::Blob::set( const char *pRhs, int32_t iSize )
156{
157 delete[] pData;
158
159 this->iSize = iSize;
160 pData = new char[iSize+1];
161 memcpy( pData, pRhs, iSize );
162 pData[iSize] = '\0';
163}
164
145Bu::Blob &Bu::Blob::operator=( const Bu::Blob &rRhs ) 165Bu::Blob &Bu::Blob::operator=( const Bu::Blob &rRhs )
146{ 166{
147 delete[] pData; 167 delete[] pData;