diff options
Diffstat (limited to 'src/list.h')
| -rw-r--r-- | src/list.h | 34 |
1 files changed, 34 insertions, 0 deletions
| @@ -82,6 +82,18 @@ namespace Bu | |||
| 82 | return *this; | 82 | return *this; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | MyType &operator+=( const value &v ) | ||
| 86 | { | ||
| 87 | append( v ); | ||
| 88 | return *this; | ||
| 89 | } | ||
| 90 | |||
| 91 | MyType &operator+=( const MyType &src ) | ||
| 92 | { | ||
| 93 | append( src ); | ||
| 94 | return *this; | ||
| 95 | } | ||
| 96 | |||
| 85 | /** | 97 | /** |
| 86 | * Clear the data from the list. | 98 | * Clear the data from the list. |
| 87 | */ | 99 | */ |
| @@ -142,6 +154,15 @@ namespace Bu | |||
| 142 | } | 154 | } |
| 143 | } | 155 | } |
| 144 | 156 | ||
| 157 | void append( const MyType &rSrc ) | ||
| 158 | { | ||
| 159 | for( typename MyType::const_iterator i = rSrc.begin(); | ||
| 160 | i != rSrc.end(); i++ ) | ||
| 161 | { | ||
| 162 | append( *i ); | ||
| 163 | } | ||
| 164 | } | ||
| 165 | |||
| 145 | /** | 166 | /** |
| 146 | * Prepend a value to the list. | 167 | * Prepend a value to the list. |
| 147 | *@param v (const value_type &) The value to prepend. | 168 | *@param v (const value_type &) The value to prepend. |
| @@ -168,6 +189,19 @@ namespace Bu | |||
| 168 | } | 189 | } |
| 169 | 190 | ||
| 170 | /** | 191 | /** |
| 192 | * Prepend another list to the front of this one. This will prepend | ||
| 193 | * the rSrc list in reverse order...I may fix that later. | ||
| 194 | */ | ||
| 195 | void prepend( const MyType &rSrc ) | ||
| 196 | { | ||
| 197 | for( typename MyType::const_iterator i = rSrc.begin(); | ||
| 198 | i != rSrc.end(); i++ ) | ||
| 199 | { | ||
| 200 | prepend( *i ); | ||
| 201 | } | ||
| 202 | } | ||
| 203 | |||
| 204 | /** | ||
| 171 | * Insert a new item in sort order by searching for the first item that | 205 | * Insert a new item in sort order by searching for the first item that |
| 172 | * is larger and inserting this before it, or at the end if none are | 206 | * is larger and inserting this before it, or at the end if none are |
| 173 | * larger. If this is the only function used to insert data in the | 207 | * larger. If this is the only function used to insert data in the |
