Planeshift
Public Member Functions | Protected Member Functions

WordArray Class Reference

WordArray is class that parses text command (e.g. More...

#include <strutil.h>

List of all members.

Public Member Functions

bool DeleteIndex (size_t n)
 Delete the n'th element from the word array.
size_t FindStr (const csString &str, int start=0) const
csString Get (size_t wordNum) const
 Returns given word, or empty string if it does not exist.
size_t GetCount () const
float GetFloat (size_t wordNum) const
bool GetFloat (size_t wordNum, float &retValue) const
int GetInt (size_t wordNum) const
bool GetInt (size_t wordNum, int &retValue) const
bool GetString (size_t wordNum, csString &retValue) const
csString GetTail (size_t wordNum) const
void GetTail (size_t wordNum, csString &dest) const
csString GetWords (size_t startWord, size_t endWord) const
bool IsFloat (size_t wordNum) const
 Check if the word is a float.
bool IsInt (size_t wordNum) const
 Check if the word is an interger.
csString operator[] (size_t wordNum) const
 WordArray (const csString &cmd, bool ignoreQuotes=true)

Protected Member Functions

size_t AddQuotedWord (const csString &cmd, size_t pos)
size_t AddWord (const csString &cmd, size_t pos)
void SkipSpaces (const csString &cmd, size_t &pos)

Detailed Description

WordArray is class that parses text command (e.g.

"/newguild Insomniac Developers") to words.

Definition at line 62 of file strutil.h.


Constructor & Destructor Documentation

WordArray::WordArray ( const csString &  cmd,
bool  ignoreQuotes = true 
)

Member Function Documentation

size_t WordArray::AddQuotedWord ( const csString &  cmd,
size_t  pos 
) [protected]
size_t WordArray::AddWord ( const csString &  cmd,
size_t  pos 
) [protected]
bool WordArray::DeleteIndex ( size_t  n) [inline]

Delete the n'th element from the word array.

Definition at line 90 of file strutil.h.

size_t WordArray::FindStr ( const csString &  str,
int  start = 0 
) const
csString WordArray::Get ( size_t  wordNum) const [inline]

Returns given word, or empty string if it does not exist.

Definition at line 75 of file strutil.h.

size_t WordArray::GetCount ( ) const [inline]

Definition at line 67 of file strutil.h.

float WordArray::GetFloat ( size_t  wordNum) const [inline]

Definition at line 178 of file strutil.h.

bool WordArray::GetFloat ( size_t  wordNum,
float retValue 
) const [inline]

Definition at line 183 of file strutil.h.

bool WordArray::GetInt ( size_t  wordNum,
int retValue 
) const [inline]

Definition at line 132 of file strutil.h.

int WordArray::GetInt ( size_t  wordNum) const [inline]

Definition at line 127 of file strutil.h.

bool WordArray::GetString ( size_t  wordNum,
csString &  retValue 
) const [inline]

Definition at line 95 of file strutil.h.

void WordArray::GetTail ( size_t  wordNum,
csString &  dest 
) const
csString WordArray::GetTail ( size_t  wordNum) const
csString WordArray::GetWords ( size_t  startWord,
size_t  endWord 
) const
bool WordArray::IsFloat ( size_t  wordNum) const [inline]

Check if the word is a float.

Definition at line 160 of file strutil.h.

bool WordArray::IsInt ( size_t  wordNum) const [inline]

Check if the word is an interger.

Definition at line 109 of file strutil.h.

csString WordArray::operator[] ( size_t  wordNum) const [inline]

Definition at line 82 of file strutil.h.

void WordArray::SkipSpaces ( const csString &  cmd,
size_t &  pos 
) [protected]

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