diff options
Diffstat (limited to '')
-rw-r--r-- | src/unstable/blobbuilder.cpp | 84 | ||||
-rw-r--r-- | src/unstable/blobbuilder.h | 3 |
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 | ||
49 | Bu::BlobBuilderCore::~BlobBuilderCore() | 54 | Bu::BlobBuilderCore::~BlobBuilderCore() |
50 | { | 55 | { |
56 | clear(); | ||
57 | } | ||
58 | |||
59 | void 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 | |||
74 | void 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 | ||
95 | void Bu::BlobBuilder::set( const Blob &rSrc ) | ||
96 | { | ||
97 | } | ||
98 | |||
99 | void Bu::BlobBuilder::set( const char *pSrc, int32_t iLength ) | ||
100 | { | ||
101 | } | ||
102 | |||
103 | void Bu::BlobBuilder::append( const Blob &rSrc ) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | void Bu::BlobBuilder::append( const char *pSrc, int32_t iLength ) | ||
108 | { | ||
109 | } | ||
110 | |||
111 | void Bu::BlobBuilder::prepend( const Blob &rSrc ) | ||
112 | { | ||
113 | } | ||
114 | |||
115 | void Bu::BlobBuilder::prepend( const char *pSrc, int32_t iLength ) | ||
116 | { | ||
117 | } | ||
118 | |||
119 | void Bu::BlobBuilder::insert( int32_t iBefore, const Blob &rSrc ) | ||
120 | { | ||
121 | } | ||
122 | |||
123 | void Bu::BlobBuilder::insert( int32_t iBefore, const char *pSrc, const Bu::Blob &rSrc ) | ||
124 | { | ||
125 | } | ||
126 | |||
127 | void Bu::BlobBuilder::clear() | ||
128 | { | ||
129 | } | ||
130 | |||
131 | int32_t Bu::BlobBuilder::getSize() const | ||
132 | { | ||
133 | } | ||
134 | |||
135 | Bu::Blob Bu::BlobBuilder::getBlob() const | ||
136 | { | ||
137 | } | ||
138 | |||
139 | Bu::BlobBuilder &Bu::BlobBuilder::operator=( const Blob &rSrc ) | ||
140 | { | ||
141 | } | ||
142 | |||
143 | Bu::BlobBuilder &Bu::BlobBuilder::operator=( const char *pSrc ) | ||
144 | { | ||
145 | } | ||
146 | |||
147 | Bu::BlobBuilder &Bu::BlobBuilder::operator+=( const Blob &rSrc ) | ||
148 | { | ||
149 | } | ||
150 | |||
151 | Bu::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 ); |