44 #ifndef CCXX_TOKENIZER_H_
45 #define CCXX_TOKENIZER_H_
47 #ifndef CCXX_MISSING_H_
51 #ifndef CCXX_THREAD_H_
55 #ifdef CCXX_NAMESPACES
138 : myTok(&tok),tokEnd(0),endp(end),token(0) {}
141 : myTok(&tok),tokEnd(0),endp(myTok->
str-1),token(0) {
146 iterator() : myTok(0),start(0),tokEnd(0),endp(0),token(0) {}
150 {
if (token) *token=
'\0';
delete [] token; }
157 myTok(i.myTok),start(i.start),tokEnd(i.tokEnd),
158 endp(i.endp),token(0) {}
187 const
char* operator * () THROWS (NoSuchElementException);
195 inline
char nextDelimiter()
const
196 {
return (tokEnd) ? *tokEnd :
'\0';}
203 inline bool operator == (
const iterator &other)
const
204 {
return (endp == other.
endp);}
211 inline bool operator != (
const iterator &other)
const
212 {
return (endp != other.
endp);}
262 bool skipAllDelim =
false,
306 #ifdef CCXX_NAMESPACES
iterator(const StringTokenizer &tok, const char *end)
The input forward iterator for tokens.
iterator begin() const
returns the begin iterator
const iterator & end() const
the iterator marking the end.
substitute functions which may be missing in target platform libc.
Synchronization and threading services.
iterator begin(const char *d)
returns a begin iterator with an alternate set of delimiters.
friend class StringTokenizer
void setDelimiters(const char *d)
changes the set of delimiters used in subsequent iterations.
iterator(const StringTokenizer &tok)
static const char *const SPACE
a delimiter string containing all usual whitespace delimiters.
Splits delimited string into tokens.
Exception thrown, if someone tried to read beyond the end of the tokens.
iterator(const iterator &i)
copy constructor.
const StringTokenizer * myTok