aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2019-06-18 18:39:38 -0700
committerMike Buland <eichlan@xagasoft.com>2019-06-18 18:39:38 -0700
commitf79794995d0cfe0af59737f9c7dba683a1ccfe84 (patch)
tree48eb6b937c2bbdb3f54cfc5db5f1677420b14043
parent8ba8268b51081b3b7d34da8fcec14d58b53f6d47 (diff)
downloadlibbu++-f79794995d0cfe0af59737f9c7dba683a1ccfe84.tar.gz
libbu++-f79794995d0cfe0af59737f9c7dba683a1ccfe84.tar.bz2
libbu++-f79794995d0cfe0af59737f9c7dba683a1ccfe84.tar.xz
libbu++-f79794995d0cfe0af59737f9c7dba683a1ccfe84.zip
Doens't build yet, but the BlobBuilder is in progress.
-rw-r--r--src/unstable/blobbuilder.cpp84
-rw-r--r--src/unstable/blobbuilder.h3
2 files changed, 87 insertions, 0 deletions
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()
25 pData = 0; 25 pData = 0;
26 delete pNext; 26 delete pNext;
27 pNext = 0; 27 pNext = 0;
28
29 // Why not delete pNext here? A BlobBuilder could easily wind up having
30 // quite a few chunks, and if it does, deleting the linked list from here
31 // could actually exhaust the program stack. Instead these are all deleted
32 // in the core down below.
28} 33}
29 34
30///// 35/////
@@ -48,8 +53,26 @@ Bu::BlobBuilderCore::BlobBuilderCore( const Bu::BlobBuilderCore &rSrc ) :
48 53
49Bu::BlobBuilderCore::~BlobBuilderCore() 54Bu::BlobBuilderCore::~BlobBuilderCore()
50{ 55{
56 clear();
57}
58
59void Bu::BlobBuilderCore::clear()
60{
61 Chunk *pCur = pFirst;
62 while( pCur )
63 {
64 Chunk *pNext = pCur->pNext;
65 delete pCur;
66 pCur = pNext;
67
68 }
51 delete pFirst; 69 delete pFirst;
52 pFirst = pLast = 0; 70 pFirst = pLast = 0;
71 iLength = 0;
72}
73
74void Bu::BlobBuilderCore::append( const *pSrc, int32_t iLength )
75{
53} 76}
54 77
55////// 78//////
@@ -69,3 +92,64 @@ Bu::BlobBuilder::~BlobBuilder()
69{ 92{
70} 93}
71 94
95void Bu::BlobBuilder::set( const Blob &rSrc )
96{
97}
98
99void Bu::BlobBuilder::set( const char *pSrc, int32_t iLength )
100{
101}
102
103void Bu::BlobBuilder::append( const Blob &rSrc )
104{
105}
106
107void Bu::BlobBuilder::append( const char *pSrc, int32_t iLength )
108{
109}
110
111void Bu::BlobBuilder::prepend( const Blob &rSrc )
112{
113}
114
115void Bu::BlobBuilder::prepend( const char *pSrc, int32_t iLength )
116{
117}
118
119void Bu::BlobBuilder::insert( int32_t iBefore, const Blob &rSrc )
120{
121}
122
123void Bu::BlobBuilder::insert( int32_t iBefore, const char *pSrc, const Bu::Blob &rSrc )
124{
125}
126
127void Bu::BlobBuilder::clear()
128{
129}
130
131int32_t Bu::BlobBuilder::getSize() const
132{
133}
134
135Bu::Blob Bu::BlobBuilder::getBlob() const
136{
137}
138
139Bu::BlobBuilder &Bu::BlobBuilder::operator=( const Blob &rSrc )
140{
141}
142
143Bu::BlobBuilder &Bu::BlobBuilder::operator=( const char *pSrc )
144{
145}
146
147Bu::BlobBuilder &Bu::BlobBuilder::operator+=( const Blob &rSrc )
148{
149}
150
151Bu::BlobBuilder &Bu::BlobBuilder::operator+=( const char *pSrc )
152{
153}
154
155
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
37 virtual ~BlobBuilderCore(); 37 virtual ~BlobBuilderCore();
38 38
39 void clear(); 39 void clear();
40 void append( const *pSrc, int32_t iLength );
40 41
41 Chunk *pFirst; 42 Chunk *pFirst;
42 Chunk *pLast; 43 Chunk *pLast;
@@ -66,6 +67,8 @@ namespace Bu
66 void clear(); 67 void clear();
67 int32_t getSize() const; 68 int32_t getSize() const;
68 69
70 Blob getBlob() const;
71
69 BlobBuilder &operator=( const Blob &rSrc ); 72 BlobBuilder &operator=( const Blob &rSrc );
70 BlobBuilder &operator=( const char *pSrc ); 73 BlobBuilder &operator=( const char *pSrc );
71 BlobBuilder &operator+=( const Blob &rSrc ); 74 BlobBuilder &operator+=( const Blob &rSrc );