Changeset 19:49b39ac77cad in rrlib_uri
- Timestamp:
- 06.01.2022 00:58:10 (2 years ago)
- Branch:
- 17.03
- Phase:
- public
- Tags:
- tip
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tPath.h
r17 r19 304 304 public: 305 305 306 tConstIterator(const tPath& path, size_t element_index) : 306 typedef long int difference_type; 307 typedef const tElement value_type; 308 typedef const tElement* pointer; 309 typedef const tElement& reference; 310 typedef std::bidirectional_iterator_tag iterator_category; 311 312 tConstIterator(const tPath& path, long int element_index) : 307 313 path(&path), 308 314 element_index(element_index), … … 340 346 return temp; 341 347 } 342 friend size_t operator+(const tConstIterator& lhs, const tConstIterator& rhs) 348 inline tConstIterator& operator--() 349 { 350 element_index--; 351 UpdateElement(); 352 return *this; 353 } 354 inline tConstIterator operator -- (int) 355 { 356 tConstIterator temp(*this); 357 operator--(); 358 return temp; 359 } 360 friend long int operator+(const tConstIterator& lhs, const tConstIterator& rhs) 343 361 { 344 362 return lhs.element_index + rhs.element_index; 345 363 } 346 friend size_t operator-(const tConstIterator& lhs, const tConstIterator& rhs)364 friend long int operator-(const tConstIterator& lhs, const tConstIterator& rhs) 347 365 { 348 366 return lhs.element_index - rhs.element_index; 349 367 } 350 friend tConstIterator operator+(const tConstIterator& lhs, size_t rhs)368 friend tConstIterator operator+(const tConstIterator& lhs, long int rhs) 351 369 { 352 370 return tConstIterator(*lhs.path, lhs.element_index + rhs); 353 371 } 354 friend tConstIterator operator-(const tConstIterator& lhs, size_t rhs)372 friend tConstIterator operator-(const tConstIterator& lhs, long int rhs) 355 373 { 356 374 return tConstIterator(*lhs.path, lhs.element_index - rhs); … … 360 378 361 379 const tPath* path; 362 size_t element_index;380 long int element_index; 363 381 tElement element; 364 382 365 383 void UpdateElement() 366 384 { 367 element = element_index>= path->element_count ? tStringRange() : (*path)[element_index];385 element = static_cast<unsigned long int>(element_index) >= path->element_count ? tStringRange() : (*path)[element_index]; 368 386 } 369 387 }; -
tStringRange.h
r0 r19 129 129 } 130 130 131 inline std::ostream& operator << (std::ostream& stream, const tStringRange& string_range) 132 { 133 stream.write(string_range.CharPointer(), string_range.Length()); 134 return stream; 135 } 136 131 137 //---------------------------------------------------------------------- 132 138 // End of namespace declaration
Note: See TracChangeset
for help on using the changeset viewer.