#include <idep_tokeniter.h>
Public Member Functions | |
| idep_TokenIter (std::istream &in) | |
| ~idep_TokenIter () | |
| void | operator++ () |
| operator const void * () const | |
| const char * | operator() () const |
Private Member Functions | |
| idep_TokenIter (const idep_TokenIter &) | |
| idep_TokenIter & | operator= (const idep_TokenIter &) |
Private Attributes | |
| idep_TokenIter_i * | d_this |
|
|
|
|
|
Definition at line 69 of file idep_tokitr.cxx. 00070 : d_this(new idep_TokenIter_i(in)) 00071 { 00072 ++*this; // load first occurrence 00073 }
|
|
|
Definition at line 75 of file idep_tokitr.cxx. 00076 {
00077 delete d_this;
00078 }
|
|
|
Definition at line 124 of file idep_tokitr.cxx. References idep_TokenIter_i::d_length, and d_this.
|
|
|
Definition at line 129 of file idep_tokitr.cxx. References idep_TokenIter_i::d_buf_p, and d_this.
|
|
|
Definition at line 80 of file idep_tokitr.cxx. References idep_TokenIter_i::addChar(), idep_TokenIter_i::d_in, idep_TokenIter_i::d_length, idep_TokenIter_i::d_newlineFlag, d_this, NEWLINE_CHAR, and NULL_CHAR. 00081 {
00082 assert(*this);
00083
00084 d_this->d_length = 0;
00085
00086 if (d_this->d_newlineFlag) { // left over newline
00087 d_this->d_newlineFlag = 0;
00088 d_this->addChar(NEWLINE_CHAR);
00089 }
00090 else {
00091 char c;
00092 while (d_this->d_in && !d_this->d_in.get(c).eof()) {
00093 if (d_this->d_length > 0) { // "word" in progress
00094 if (isspace(c)) {
00095 if (NEWLINE_CHAR == c) {
00096 d_this->d_newlineFlag = 1; // note newline for later
00097 }
00098 break; // end of "word" in any case
00099 }
00100 d_this->addChar(c); // start of "word"
00101 }
00102 else { // nothing found yet
00103 if (isspace(c)) {
00104 if (NEWLINE_CHAR == c) {
00105 d_this->addChar(NEWLINE_CHAR);
00106 break; // found a newline
00107 }
00108 continue; // found an ordinary space
00109 }
00110 d_this->addChar(c); // add character to "word"
00111 }
00112 }
00113 }
00114
00115 if (d_this->d_length > 0) {
00116 d_this->addChar(NULL_CHAR); // always append a null char
00117 }
00118 else {
00119 d_this->d_length = -1; // or make iterator invalid
00120 }
00121 }
|
|
|
|
|
|
Definition at line 12 of file idep_tokeniter.h. Referenced by operator const void *(), operator()(), and operator++(). |
1.3.9.1