#include <OSGBaseFunctions.h>
Public Member Functions | |
| string_token_iterator () | |
| string_token_iterator (const std::string &str_, const char *separator_=" ") | |
| string_token_iterator (const string_token_iterator &rhs) | |
| string_token_iterator & | operator++ () |
| string_token_iterator | operator++ (int) |
| std::string | operator* () const |
| bool | operator== (const string_token_iterator &rhs) const |
| bool | operator!= (const string_token_iterator &rhs) const |
Private Member Functions | |
| void | find_next (void) |
Private Attributes | |
| const char * | _separator |
| const std::string * | _str |
| std::string::size_type | _start |
| std::string::size_type | _end |
Definition at line 451 of file OSGBaseFunctions.h.
| string_token_iterator::string_token_iterator | ( | const std::string & | str_, | |
| const char * | separator_ = " " | |||
| ) |
Definition at line 557 of file OSGBaseFunctions.cpp.
References find_next().
00558 : 00559 _separator(separator), 00560 _str(&str), 00561 _end(0) 00562 { 00563 find_next(); 00564 }
| string_token_iterator::string_token_iterator | ( | const string_token_iterator & | rhs | ) |
Definition at line 566 of file OSGBaseFunctions.cpp.
00566 : 00567 _separator(rhs._separator), 00568 _str(rhs._str), 00569 _start(rhs._start), 00570 _end(rhs._end) 00571 { 00572 }
| string_token_iterator & string_token_iterator::operator++ | ( | ) |
Definition at line 574 of file OSGBaseFunctions.cpp.
References find_next().
00575 { 00576 find_next(); 00577 return *this; 00578 }
| string_token_iterator string_token_iterator::operator++ | ( | int | ) |
Definition at line 580 of file OSGBaseFunctions.cpp.
00581 { 00582 string_token_iterator temp(*this); 00583 ++(*this); 00584 return temp; 00585 }
| std::string string_token_iterator::operator* | ( | ) | const |
| bool string_token_iterator::operator== | ( | const string_token_iterator & | rhs | ) | const |
| bool string_token_iterator::operator!= | ( | const string_token_iterator & | rhs | ) | const |
| void string_token_iterator::find_next | ( | void | ) | [private] |
Definition at line 609 of file OSGBaseFunctions.cpp.
References _end, _separator, _start, and _str.
Referenced by operator++(), and string_token_iterator().
00610 { 00611 _start = _str->find_first_not_of(_separator, _end); 00612 // Apparently some STL implementations don't do npos !?! 00613 if(_start == std::string::npos || _start >= _str->length()) 00614 { 00615 _start = _end = 0; 00616 _str = 0; 00617 return; 00618 } 00619 00620 _end = _str->find_first_of(_separator, _start); 00621 }
const char* osg::string_token_iterator::_separator [private] |
const std::string* osg::string_token_iterator::_str [private] |
Definition at line 481 of file OSGBaseFunctions.h.
Referenced by find_next(), operator*(), and operator==().
std::string::size_type osg::string_token_iterator::_start [private] |
Definition at line 482 of file OSGBaseFunctions.h.
Referenced by find_next(), operator*(), and operator==().
std::string::size_type osg::string_token_iterator::_end [private] |
Definition at line 483 of file OSGBaseFunctions.h.
Referenced by find_next(), operator*(), and operator==().
1.5.5