From f79794995d0cfe0af59737f9c7dba683a1ccfe84 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 18 Jun 2019 18:39:38 -0700 Subject: Doens't build yet, but the BlobBuilder is in progress. --- src/unstable/blobbuilder.cpp | 84 ++++++++++++++++++++++++++++++++++++++++++++ src/unstable/blobbuilder.h | 3 ++ 2 files changed, 87 insertions(+) diff --git a/src/unstable/blobbuilder.cpp b/src/unstable/blobbuilder.cpp index a3f686e..a62b98c 100644 --- a/src/unstable/blobbuilder.cpp +++ b/src/unstable/blobbuilder.cpp @@ -25,6 +25,11 @@ Bu::BlobBuilderCore::Chunk::~Chunk() pData = 0; delete pNext; pNext = 0; + + // Why not delete pNext here? A BlobBuilder could easily wind up having + // quite a few chunks, and if it does, deleting the linked list from here + // could actually exhaust the program stack. Instead these are all deleted + // in the core down below. } ///// @@ -48,8 +53,26 @@ Bu::BlobBuilderCore::BlobBuilderCore( const Bu::BlobBuilderCore &rSrc ) : Bu::BlobBuilderCore::~BlobBuilderCore() { + clear(); +} + +void Bu::BlobBuilderCore::clear() +{ + Chunk *pCur = pFirst; + while( pCur ) + { + Chunk *pNext = pCur->pNext; + delete pCur; + pCur = pNext; + + } delete pFirst; pFirst = pLast = 0; + iLength = 0; +} + +void Bu::BlobBuilderCore::append( const *pSrc, int32_t iLength ) +{ } ////// @@ -69,3 +92,64 @@ Bu::BlobBuilder::~BlobBuilder() { } +void Bu::BlobBuilder::set( const Blob &rSrc ) +{ +} + +void Bu::BlobBuilder::set( const char *pSrc, int32_t iLength ) +{ +} + +void Bu::BlobBuilder::append( const Blob &rSrc ) +{ +} + +void Bu::BlobBuilder::append( const char *pSrc, int32_t iLength ) +{ +} + +void Bu::BlobBuilder::prepend( const Blob &rSrc ) +{ +} + +void Bu::BlobBuilder::prepend( const char *pSrc, int32_t iLength ) +{ +} + +void Bu::BlobBuilder::insert( int32_t iBefore, const Blob &rSrc ) +{ +} + +void Bu::BlobBuilder::insert( int32_t iBefore, const char *pSrc, const Bu::Blob &rSrc ) +{ +} + +void Bu::BlobBuilder::clear() +{ +} + +int32_t Bu::BlobBuilder::getSize() const +{ +} + +Bu::Blob Bu::BlobBuilder::getBlob() const +{ +} + +Bu::BlobBuilder &Bu::BlobBuilder::operator=( const Blob &rSrc ) +{ +} + +Bu::BlobBuilder &Bu::BlobBuilder::operator=( const char *pSrc ) +{ +} + +Bu::BlobBuilder &Bu::BlobBuilder::operator+=( const Blob &rSrc ) +{ +} + +Bu::BlobBuilder &Bu::BlobBuilder::operator+=( const char *pSrc ) +{ +} + + diff --git a/src/unstable/blobbuilder.h b/src/unstable/blobbuilder.h index 5416cb4..c1dbed1 100644 --- a/src/unstable/blobbuilder.h +++ b/src/unstable/blobbuilder.h @@ -37,6 +37,7 @@ namespace Bu virtual ~BlobBuilderCore(); void clear(); + void append( const *pSrc, int32_t iLength ); Chunk *pFirst; Chunk *pLast; @@ -66,6 +67,8 @@ namespace Bu void clear(); int32_t getSize() const; + Blob getBlob() const; + BlobBuilder &operator=( const Blob &rSrc ); BlobBuilder &operator=( const char *pSrc ); BlobBuilder &operator+=( const Blob &rSrc ); -- cgit v1.2.3