xvr2::Tokenizer Class Reference

#include <Tokenizer.h>

Inheritance diagram for xvr2::Tokenizer:

Inheritance graph
[legend]

List of all members.


Detailed Description

This utilitary class is used whenever you need to split a string into tokens iteratively.

Definition at line 26 of file Tokenizer.h.


Public Member Functions

 Tokenizer (char *string, char *delim)
 This constructor takes two arguments: string: is the string to be splitted delim: the delimiter.
 Tokenizer (const String &string, const String &delim)
 This constructor takes two arguments: string: is the string to be splitted delim: the delimiter.
 ~Tokenizer ()
 This destructor takes charge of releasing all the memory allocated by all the private members.
const Stringnext ()
 When called returns the next token in the string, if there are not any more tokens, then this method will throw a NoMoreTokens exception.
bool finished ()
 Call this method in order to know if there are any more tokens to read.
virtual const char * getClassName ()
 Returns the name of the current class.
virtual std::string toString ()

Static Public Member Functions

static void usleep (UInt32 usec)
 This will return how many CPUs are installed in the system.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Member Functions

char * cnext ()
 When called returns the next token in the string.

Protected Attributes

std::string __cls_name

Private Attributes

char * temp
 Reserved use.
char * buffer
 Contains the string to be splitted.
char * token
 Is a pointer to the las token obtained.
char * delim
 Stores the delimiter.
String tstr
 Stores a temporal copy of buffer as a String.
bool _fin
 Flag to say if there are more tokens or not.

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Constructor & Destructor Documentation

xvr2::Tokenizer::Tokenizer ( char *  string,
char *  delim 
)

This constructor takes two arguments: string: is the string to be splitted delim: the delimiter.

xvr2::Tokenizer::Tokenizer ( const String string,
const String delim 
)

This constructor takes two arguments: string: is the string to be splitted delim: the delimiter.

xvr2::Tokenizer::~Tokenizer (  ) 

This destructor takes charge of releasing all the memory allocated by all the private members.


Member Function Documentation

char* xvr2::Tokenizer::cnext (  )  [protected]

When called returns the next token in the string.

const String& xvr2::Tokenizer::next (  ) 

When called returns the next token in the string, if there are not any more tokens, then this method will throw a NoMoreTokens exception.

bool xvr2::Tokenizer::finished (  ) 

Call this method in order to know if there are any more tokens to read.

static void xvr2::System::usleep ( UInt32  usec  )  [static, inherited]

This will return how many CPUs are installed in the system.

This will return the CPU speed in megahertz Will return the total amount of system memory Will return the total amount of free system memory Will freeze the software for usec microseconds

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

virtual std::string xvr2::Object::toString (  )  [virtual, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

char* xvr2::Tokenizer::temp [private]

Reserved use.

Definition at line 29 of file Tokenizer.h.

char* xvr2::Tokenizer::buffer [private]

Contains the string to be splitted.

Definition at line 31 of file Tokenizer.h.

char* xvr2::Tokenizer::token [private]

Is a pointer to the las token obtained.

Definition at line 33 of file Tokenizer.h.

char* xvr2::Tokenizer::delim [private]

Stores the delimiter.

Definition at line 35 of file Tokenizer.h.

Stores a temporal copy of buffer as a String.

Definition at line 37 of file Tokenizer.h.

bool xvr2::Tokenizer::_fin [private]

Flag to say if there are more tokens or not.

Definition at line 39 of file Tokenizer.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:59 2008 for X-VR2 SDK by  doxygen 1.5.5