sipxportlib  Version 3.3
Public Member Functions | Static Public Member Functions | List of all members
UtlTokenizer Class Reference

#include <UtlTokenizer.h>

Public Member Functions

 UtlTokenizer (const UtlString &tokens)
virtual ~UtlTokenizer ()
UtlBoolean next (UtlString &token, const char *delim)

Static Public Member Functions

static int nextDelim (const char *tokens, const int start, const int len, const char *delim)
static UtlBoolean isDelim (const char c, const char *delim)

Detailed Description

C++ version of strtok, but obvisously reentrant.

Constructor & Destructor Documentation

UtlTokenizer ( const UtlString tokens)

Default constructor

~UtlTokenizer ( )


Member Function Documentation

int nextDelim ( const char *  tokens,
const int  start,
const int  len,
const char *  delim 
UtlBoolean isDelim ( const char  c,
const char *  delim 
UtlBoolean next ( UtlString token,
const char *  delim 

Tokenize a string into a series of smaller strings based on a set of single character delimiters. Delimitters are not returned and can vary with each call to this method.

Sample token strings and token counts where delimitters = "X"

| string | count | +----------—+----—+ —X—X— 3 X–X– 2 — 1 —X 1 —X 1 —XXX— 2 XXXX 0