aboutsummaryrefslogtreecommitdiff
path: root/src/unstable/blob.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2019-05-25 15:47:58 -0700
committerMike Buland <eichlan@xagasoft.com>2019-05-25 15:47:58 -0700
commitc4c34c1bfe568b653399cb5349ce54b5ee1c519b (patch)
tree4650a248020f89c64fc3919618987ef4c8961cf6 /src/unstable/blob.h
parent00cef0e9a21e1ee07d622bb05c3a7e4e56425723 (diff)
downloadlibbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.gz
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.bz2
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.tar.xz
libbu++-c4c34c1bfe568b653399cb5349ce54b5ee1c519b.zip
Augmented UnitSuite, added more to Blob, and added tests.
Diffstat (limited to 'src/unstable/blob.h')
-rw-r--r--src/unstable/blob.h37
1 files changed, 36 insertions, 1 deletions
diff --git a/src/unstable/blob.h b/src/unstable/blob.h
index 5b8cabd..6ce0c67 100644
--- a/src/unstable/blob.h
+++ b/src/unstable/blob.h
@@ -33,12 +33,31 @@ namespace Bu
33 33
34 int32_t getSize() const; 34 int32_t getSize() const;
35 char *getData() const; 35 char *getData() const;
36
37 char *c_str() const; 36 char *c_str() const;
38 37
38 char &operator[]( int32_t iIndex );
39 char operator[]( int32_t iIndex ) const;
40
41 bool isEmpty() const;
42 bool isNull() const;
43 bool isNullOrEmpty() const;
44
39 Blob &operator=( const Blob &rRhs ); 45 Blob &operator=( const Blob &rRhs );
40 Blob &operator=( const char *pRhs ); 46 Blob &operator=( const char *pRhs );
41 47
48 bool operator==( const Blob &rRhs ) const;
49 bool operator==( const char *rRhs ) const;
50 bool operator!=( const Blob &rRhs ) const;
51 bool operator!=( const char *rRhs ) const;
52 bool operator<( const Blob &rRhs ) const;
53 bool operator<( const char *rRhs ) const;
54 bool operator<=( const Blob &rRhs ) const;
55 bool operator<=( const char *rRhs ) const;
56 bool operator>( const Blob &rRhs ) const;
57 bool operator>( const char *rRhs ) const;
58 bool operator>=( const Blob &rRhs ) const;
59 bool operator>=( const char *rRhs ) const;
60
42 class const_iterator; 61 class const_iterator;
43 class iterator 62 class iterator
44 { 63 {
@@ -119,6 +138,22 @@ namespace Bu
119 char *pData; 138 char *pData;
120 int32_t iSize; 139 int32_t iSize;
121 }; 140 };
141
142 template<typename T>
143 uint32_t __calcHashCode( const T &k );
144
145 template<typename T>
146 bool __cmpHashKeys( const T &a, const T &b );
147
148 template<> uint32_t __calcHashCode<Blob>( const Blob &k );
149 template<> bool __cmpHashKeys<Blob>(
150 const Blob &a, const Blob &b );
151
152 template<typename t> void __tracer_format( const t &v );
153 template<> void __tracer_format<Blob>( const Blob &v );
154
155 class Formatter;
156 Formatter &operator<<( Formatter &rOut, const Blob &b );
122} 157}
123 158
124#endif 159#endif