25 #ifndef COMMON_STREAMTOKENIZER_H 26 #define COMMON_STREAMTOKENIZER_H 36 class SeekableReadStream;
163 static bool isIn(
uint32 c,
const std::list<uint32> &list);
170 #endif // COMMON_STREAMTOKENIZER_H
A class holding an UTF-8 string.
bool isChunkEnd(SeekableReadStream &stream)
UString getToken(SeekableReadStream &stream)
Parse a token out of the stream.
void addChunkEnd(uint32 c)
Add a character marking the end of a chunk.
static bool isIn(uint32 c, const std::list< uint32 > &list)
Low-level type definitions to handle fixed width types portably.
std::list< uint32 > _quotes
void addIgnore(uint32 c)
Add a character to ignore.
StreamTokenizer(ConsecutiveSeparatorRule conSepRule=kRuleHeed)
std::list< uint32 > _chunkEnds
void findFirstToken(SeekableReadStream &stream)
Find the first token character, skipping past separators.
size_t getTokens(SeekableReadStream &stream, std::vector< UString > &list, size_t min=0, size_t max=SIZE_MAX, const UString &def="")
Parse tokens out of the stream.
std::list< uint32 > _ignores
ConsecutiveSeparatorRule _conSepRule
ConsecutiveSeparatorRule
What to do when consecutive separator are found.
void nextChunk(SeekableReadStream &stream)
Skip past end of chunk characters.
Ignore all repeated separators.
void skipChunk(SeekableReadStream &stream)
Skip to the end of the chunk.
void addSeparator(uint32 c)
Add a character on where to split tokens.
void skipToken(SeekableReadStream &stream, size_t n=1)
Skip a number of tokens.
std::list< uint32 > _separators
Ignore the repeated separator, but only if it's the same.
void addQuote(uint32 c)
Add a character able to enclose (quote) separators and chunk ends.
Interface for a seekable & readable data stream.