MinitScript  0.9.31 PRE-BETA
Public Member Functions | Private Attributes | List of all members
StringTokenizer Class Reference

String tokenizer class. More...

#include <minitscript/utilities/StringTokenizer.h>

Collaboration diagram for StringTokenizer:
Collaboration graph

Public Member Functions

 StringTokenizer ()
 Public constructor. More...
 
void tokenize (const string &str, const string &delimiters, bool emptyTokens=false)
 Tokenize. More...
 
int32_t countTokens ()
 
bool hasMoreTokens ()
 
const string & nextToken ()
 
const vector< string > & getTokens ()
 

Private Attributes

vector< string > tokens
 
int idx { 0 }
 

Detailed Description

String tokenizer class.

Author
Andreas Drewke

Definition at line 17 of file StringTokenizer.h.

Constructor & Destructor Documentation

◆ StringTokenizer()

Public constructor.

Definition at line 11 of file StringTokenizer.cpp.

Member Function Documentation

◆ tokenize()

void tokenize ( const string &  str,
const string &  delimiters,
bool  emptyTokens = false 
)

Tokenize.

Parameters
strstring to tokenize
delimitersdelimiters
emptyTokensinclude empty tokens

Definition at line 14 of file StringTokenizer.cpp.

◆ countTokens()

int32_t countTokens ( )
inline
Returns
number of tokens

Definition at line 41 of file StringTokenizer.h.

◆ hasMoreTokens()

bool hasMoreTokens ( )
inline
Returns
has more tokens

Definition at line 48 of file StringTokenizer.h.

◆ nextToken()

const string& nextToken ( )
inline
Returns
next token

Definition at line 55 of file StringTokenizer.h.

◆ getTokens()

const vector<string>& getTokens ( )
inline
Returns
tokens

Definition at line 62 of file StringTokenizer.h.

Member Data Documentation

◆ tokens

vector<string> tokens
private

Definition at line 21 of file StringTokenizer.h.

◆ idx

int idx { 0 }
private

Definition at line 22 of file StringTokenizer.h.


The documentation for this class was generated from the following files: