Go to the documentation of this file.
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) {}
167 start = i.start; endp = i.endp; tokEnd = i.tokEnd;
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
StringTokenizer(const char *s)
create a new StringTokenizer which splits the input string at whitespaces.
virtual ~iterator()
Definition: tokenizer.h:149
StringTokenizer(const char *str, const char *delim, bool skipAllDelim=false, bool trim=false)
creates a new StringTokenizer for a string and a given set of delimiters.
iterator begin() const
returns the begin iterator
Definition: tokenizer.h:279
#define __EXPORT
Definition: config.h:979
Splits delimited string into tokens.
Definition: tokenizer.h:102
iterator begin(const char *d)
returns a begin iterator with an alternate set of delimiters.
Definition: tokenizer.h:293
substitute functions which may be missing in target platform libc.
iterator(const iterator &i)
copy constructor.
Definition: tokenizer.h:156
const iterator & end() const
the iterator marking the end.
Definition: tokenizer.h:302
The input forward iterator for tokens.
Definition: tokenizer.h:127
#define THROWS(x)
Definition: config.h:944
iterator()
Definition: tokenizer.h:146
void setDelimiters(const char *d)
changes the set of delimiters used in subsequent iterations.
Definition: tokenizer.h:286
Synchronization and threading services.
Exception thrown, if someone tried to read beyond the end of the tokens.
Definition: tokenizer.h:121
static const char *const SPACE
a delimiter string containing all usual whitespace delimiters.
Definition: tokenizer.h:109