44#ifndef CCXX_TOKENIZER_H_
45#define CCXX_TOKENIZER_H_
47#ifndef CCXX_MISSING_H_
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
Exception thrown, if someone tried to read beyond the end of the tokens.
Definition tokenizer.h:121
The input forward iterator for tokens.
Definition tokenizer.h:127
iterator(const iterator &i)
copy constructor.
Definition tokenizer.h:156
virtual ~iterator()
Definition tokenizer.h:149
iterator()
Definition tokenizer.h:146
Splits delimited string into tokens.
Definition tokenizer.h:102
void setDelimiters(const char *d)
changes the set of delimiters used in subsequent iterations.
Definition tokenizer.h:286
static const char *const SPACE
a delimiter string containing all usual whitespace delimiters.
Definition tokenizer.h:109
iterator begin() const
returns the begin iterator
Definition tokenizer.h:279
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.
const iterator & end() const
the iterator marking the end.
Definition tokenizer.h:302
StringTokenizer(const char *s)
create a new StringTokenizer which splits the input string at whitespaces.
iterator begin(const char *d)
returns a begin iterator with an alternate set of delimiters.
Definition tokenizer.h:293
#define THROWS(x)
Definition config.h:1010
#define __EXPORT
Definition config.h:1045
substitute functions which may be missing in target platform libc.
Synchronization and threading services.