ddc
|
#include <ddcString.h>
Public Member Functions | |
StringTokenizer (const char *_text, const char *_delims=" \\) | |
StringTokenizer (const std::string &_text, const std::string &_delims) | |
! moo: constructor from std::string (implicitly calls c_str() on arguments) More... | |
~StringTokenizer () | |
void | initialize (const char *_text, const char *_delims=" \\) |
void | reinitialize (const char *_text, const char *_delims=" \\) |
void | initialize (const std::string &_text, const std::string &_delims) |
! moo: initialize from std::string (copies) More... | |
const char * | operator() () |
std::string | next_token () |
const char * | get_rest () const |
const char * | val () const |
int | count () const |
bool | has_next () const |
void | get_tokens (std::vector< std::string > &tokens) |
moo: append all remaining tokens to a string vector (consumes the rest of the source string) More... | |
const char * | get_rest_trim () |
moo: get all remaining text as a single token, trimming any initial or trailing delimiters More... | |
Protected Member Functions | |
bool | is_delim (char ch) const |
Protected Attributes | |
char * | text_ptr |
char * | text |
int | i |
std::string | delims |
char * | _val |
old string tokenizer from ../CommonLib/util_classes.h, utilit.cpp, rsp. ../CommonLib/string_tokenizer.h see also stringSplitE() from utilit.cpp re-entrant replacement of strtok().
Usage (C-strings): char *text = "word, word2;word3" CStringTokenizer token(text, " ,;"); const char *word; while((word = token())){ handle token here }
StringTokenizer::StringTokenizer | ( | const char * | _text, |
const char * | _delims = " \t\r\n" |
||
) |
|
inline |
! moo: constructor from std::string (implicitly calls c_str() on arguments)
References initialize(), reinitialize(), and ~StringTokenizer().
StringTokenizer::~StringTokenizer | ( | ) |
|
inlineprotected |
void StringTokenizer::initialize | ( | const char * | _text, |
const char * | _delims = " \t\r\n" |
||
) |
void StringTokenizer::reinitialize | ( | const char * | _text, |
const char * | _delims = " \t\r\n" |
||
) |
|
inline |
! moo: initialize from std::string (copies)
References initialize(), next_token(), and operator()().
const char * StringTokenizer::operator() | ( | ) |
std::string StringTokenizer::next_token | ( | ) |
Referenced by initialize(), parseTermExpanderSpec(), TRoss::ReadConfig(), CHitBorders::RegisterBorderIndices(), and CStringIndexator::RegisterIndexAliases().
|
inline |
|
inline |
References _val.
Referenced by TItemContainer::BuildDomens(), TItemContainer::BuildDomItems(), TItemContainer::BuildFields(), BuildOborottosIndex(), TItemContainer::BuildOneFieldFormat(), EchoOptionLines(), MorphoWizard::load_wizard(), CTempArticle::MarkUp(), mkdirhier(), CAgramtab::ProcessPOSAndGrammems(), TRoss::ReadConfig(), CHighlightTags::ReadFromString(), CAccentModel::ReadFromString(), TRoss::ReadFromStrWithOneSignatura(), CLemmatizer::ReadOptions(), CDwdsThesaurus::ReadPathFromString(), CHitBorders::RegisterBorderIndices(), CBiblIndex::RegisterFreeBiblAttributes(), CStringIndexator::RegisterIndexAliases(), CConcordance::RegisterIndicesToShow(), CStringIndexator::RegisterStringIndices(), and CBiblIndex::RegisterTextAreas().
|
inline |
References i.
|
inline |
void StringTokenizer::get_tokens | ( | std::vector< std::string > & | tokens | ) |
moo: append all remaining tokens to a string vector (consumes the rest of the source string)
Referenced by has_next(), and stringSplit().
const char * StringTokenizer::get_rest_trim | ( | ) |
moo: get all remaining text as a single token, trimming any initial or trailing delimiters
Referenced by has_next().
|
protected |
|
protected |
Referenced by get_rest().
|
protected |
Referenced by count().
|
protected |
|
protected |
Referenced by val().