diff options
author | Mike Buland <eichlan@xagasoft.com> | 2019-05-25 20:34:29 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2019-05-25 20:34:29 -0700 |
commit | 3a27454dca4a16d021a4d418f0725adccc5baabb (patch) | |
tree | 583e0865283ad29d769c6c646e227c9571c33361 /src/unstable/blob.h | |
parent | c4c34c1bfe568b653399cb5349ce54b5ee1c519b (diff) | |
download | libbu++-3a27454dca4a16d021a4d418f0725adccc5baabb.tar.gz libbu++-3a27454dca4a16d021a4d418f0725adccc5baabb.tar.bz2 libbu++-3a27454dca4a16d021a4d418f0725adccc5baabb.tar.xz libbu++-3a27454dca4a16d021a4d418f0725adccc5baabb.zip |
Just about everything that Blob needs is in.
Diffstat (limited to 'src/unstable/blob.h')
-rw-r--r-- | src/unstable/blob.h | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/unstable/blob.h b/src/unstable/blob.h index 6ce0c67..daee5f9 100644 --- a/src/unstable/blob.h +++ b/src/unstable/blob.h | |||
@@ -25,10 +25,16 @@ namespace Bu | |||
25 | class Blob | 25 | class Blob |
26 | { | 26 | { |
27 | public: | 27 | public: |
28 | class iterator; | ||
29 | class const_iterator; | ||
30 | |||
31 | public: | ||
28 | Blob(); | 32 | Blob(); |
29 | Blob( const Blob &rSrc ); | 33 | Blob( const Blob &rSrc ); |
30 | Blob( const char *pSrc ); | 34 | Blob( const char *pSrc ); |
31 | Blob( const void *pSrc, int32_t iSize ); | 35 | Blob( const void *pSrc, int32_t iSize ); |
36 | Blob( const const_iterator &iStart ); | ||
37 | Blob( const const_iterator &iStart, const const_iterator &iEnd ); | ||
32 | virtual ~Blob(); | 38 | virtual ~Blob(); |
33 | 39 | ||
34 | int32_t getSize() const; | 40 | int32_t getSize() const; |
@@ -58,13 +64,22 @@ namespace Bu | |||
58 | bool operator>=( const Blob &rRhs ) const; | 64 | bool operator>=( const Blob &rRhs ) const; |
59 | bool operator>=( const char *rRhs ) const; | 65 | bool operator>=( const char *rRhs ) const; |
60 | 66 | ||
61 | class const_iterator; | 67 | iterator begin(); |
68 | const_iterator begin() const; | ||
69 | iterator end(); | ||
70 | const_iterator end() const; | ||
71 | iterator rbegin(); | ||
72 | const_iterator rbegin() const; | ||
73 | iterator rend(); | ||
74 | const_iterator rend() const; | ||
75 | |||
62 | class iterator | 76 | class iterator |
63 | { | 77 | { |
64 | friend class Blob; | 78 | friend class Blob; |
65 | friend class const_iterator; | 79 | friend class const_iterator; |
66 | private: | 80 | private: |
67 | iterator( Blob *pBlob, bool bForward ); | 81 | iterator( Blob *pBlob, bool bForward ); |
82 | iterator( Blob *pBlob, int32_t iIndex, bool bForward ); | ||
68 | 83 | ||
69 | public: | 84 | public: |
70 | iterator(); | 85 | iterator(); |
@@ -74,10 +89,12 @@ namespace Bu | |||
74 | operator bool() const; | 89 | operator bool() const; |
75 | char &operator *(); | 90 | char &operator *(); |
76 | 91 | ||
77 | iterator &operator++( int ); | 92 | iterator &operator++( int32_t ); |
78 | iterator &operator++(); | 93 | iterator &operator++(); |
79 | iterator &operator--( int ); | 94 | iterator &operator--( int32_t ); |
80 | iterator &operator--(); | 95 | iterator &operator--(); |
96 | iterator operator+( int32_t iDelta ) const; | ||
97 | iterator operator-( int32_t iDelta ) const; | ||
81 | bool operator==( const iterator &rRhs ); | 98 | bool operator==( const iterator &rRhs ); |
82 | bool operator==( const const_iterator &rRhs ); | 99 | bool operator==( const const_iterator &rRhs ); |
83 | bool operator!=( const iterator &rRhs ); | 100 | bool operator!=( const iterator &rRhs ); |
@@ -97,6 +114,7 @@ namespace Bu | |||
97 | friend class iterator; | 114 | friend class iterator; |
98 | private: | 115 | private: |
99 | const_iterator( const Blob *pBlob, bool bForward ); | 116 | const_iterator( const Blob *pBlob, bool bForward ); |
117 | const_iterator( const Blob *pBlob, int32_t iIndex, bool bForward ); | ||
100 | 118 | ||
101 | public: | 119 | public: |
102 | const_iterator(); | 120 | const_iterator(); |
@@ -107,10 +125,12 @@ namespace Bu | |||
107 | operator bool() const; | 125 | operator bool() const; |
108 | char operator *() const; | 126 | char operator *() const; |
109 | 127 | ||
110 | const_iterator &operator++( int ); | 128 | const_iterator &operator++( int32_t ); |
111 | const_iterator &operator++(); | 129 | const_iterator &operator++(); |
112 | const_iterator &operator--( int ); | 130 | const_iterator &operator--( int32_t ); |
113 | const_iterator &operator--(); | 131 | const_iterator &operator--(); |
132 | const_iterator operator+( int32_t iDelta ) const; | ||
133 | const_iterator operator-( int32_t iDelta ) const; | ||
114 | bool operator==( const iterator &rRhs ); | 134 | bool operator==( const iterator &rRhs ); |
115 | bool operator==( const const_iterator &rRhs ); | 135 | bool operator==( const const_iterator &rRhs ); |
116 | bool operator!=( const iterator &rRhs ); | 136 | bool operator!=( const iterator &rRhs ); |
@@ -125,15 +145,6 @@ namespace Bu | |||
125 | bool bForward; | 145 | bool bForward; |
126 | }; | 146 | }; |
127 | 147 | ||
128 | iterator begin(); | ||
129 | const_iterator begin() const; | ||
130 | iterator end(); | ||
131 | const_iterator end() const; | ||
132 | iterator rbegin(); | ||
133 | const_iterator rbegin() const; | ||
134 | iterator rend(); | ||
135 | const_iterator rend() const; | ||
136 | |||
137 | private: | 148 | private: |
138 | char *pData; | 149 | char *pData; |
139 | int32_t iSize; | 150 | int32_t iSize; |