DSL
Public Member Functions | List of all members
StrTokenizer Class Reference

#include <GenLib.h>

Public Member Functions

 StrTokenizer (char *str, char separater, bool do_strdup=true)
 
size_t NumTok ()
 
char * GetTok (size_t first, size_t last)
 
char * GetSingleTok (size_t num)
 
void FreeString (char *buf)
 You must call this on any string returned by GetTok/GetSingleTok.
 
std::string stdGetTok (size_t first, size_t last)
 
std::string stdGetSingleTok (size_t num)
 

Detailed Description

String tokenizer class, similar to strtok but only using one character as a delimiter. This was inspired by mIRC back in the day so the tokens are base 1 instead of base 0 for their indexes.

Definition at line 281 of file GenLib.h.

Constructor & Destructor Documentation

◆ StrTokenizer()

StrTokenizer::StrTokenizer ( char *  str,
char  separater,
bool  do_strdup = true 
)
Parameters
strThe string to split up
separaterThe character to split at
do_strdupIf true we will strdup the string and operate on our own copy. If false the original string you pass will be modified.

Definition at line 30 of file GenLib.cpp.


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