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

Parses name value pairs from multiple lines of text. More...

#include <UtlNameValueTokenizer.h>

Public Member Functions

 UtlNameValueTokenizer (const char *multiLineText, int textLength=-1)
 Constructor. More...
 
virtual ~UtlNameValueTokenizer ()
 Destructor. More...
 
UtlBoolean getNextPair (char separator, UtlString *name, UtlString *value)
 
UtlBoolean isAtEnd ()
 
int getProcessedIndex ()
 

Static Public Member Functions

static int findNextLineTerminator (const char *text, int length, int *nextLineIndex)
 Finds the index to the next line terminator. More...
 
static UtlBoolean getSubField (const char *textField, int subfieldIndex, const char *subfieldSeparator, UtlString *subfieldText, int *lastCharIndex=NULL)
 
static UtlBoolean getSubField (const char *textField, int textFieldLength, int subfieldIndex, const char *subfieldSeparators, const char *&subfieldPtr, int &subFieldLength, int *lastCharIndex)
 

Detailed Description

Parses name value pairs from multiple lines of text.

Constructor & Destructor Documentation

UtlNameValueTokenizer ( const char *  multiLineText,
int  textLength = -1 
)

Constructor.

~UtlNameValueTokenizer ( )
virtual

Destructor.

Member Function Documentation

int findNextLineTerminator ( const char *  text,
int  length,
int *  nextLineIndex 
)
static

Finds the index to the next line terminator.

Parameters
[in]text- The char array in which to search for the terminator.
[in]length- The length of the text array.
[in]nextLineIndex- The index to the beginning of the next line. This may be -1 if the end of the string is encountered.
Note
The line terminator may be 1 or 2 characters.
Returns
Index into the text char array to the line terminator.
UtlBoolean getSubField ( const char *  textField,
int  subfieldIndex,
const char *  subfieldSeparator,
UtlString subfieldText,
int *  lastCharIndex = NULL 
)
static
UtlBoolean getSubField ( const char *  textField,
int  textFieldLength,
int  subfieldIndex,
const char *  subfieldSeparators,
const char *&  subfieldPtr,
int &  subFieldLength,
int *  lastCharIndex 
)
static
UtlBoolean getNextPair ( char  separator,
UtlString name,
UtlString value 
)
UtlBoolean isAtEnd ( )
int getProcessedIndex ( )