Open Reality Reference Guide
 
Loading...
Searching...
No Matches
FBStringList Class Reference

String list. More...

#include <fbstring.h>

Public Member Functions

 FBStringList ()
 Constructor.
 
 FBStringList (const char *pString, const char pSeparator='~')
 Constructor.
 
 FBStringList (const FBStringList &pOther)
 Copy constructor.
 
FBStringListoperator= (const FBStringList &pOther)
 Overload assignment operator to support deep copy.
 
 ~FBStringList ()
 Destructor.
 
KStringList * GetInternal () const
 Get internal variable.
 
kReference GetReferenceAt (int pIndex) const
 Get the reference store with the string at pIndex.
 
void SetReferenceAt (int pIndex, kReference pRef)
 Set the reference stored with the string at pIndex.
 
int Find (kReference pRef) const
 Find the index where pRef is stored.
 
int Find (const char *pString, bool pCaseSensitive=true, bool pStartWith=false) const
 Find the index with the string pString (or start with pString)
 
const char * GetAt (int pIndex) const
 Get the string at pIndex.
 
const char * operator[] (int pIndex) const
 Overloaded [] operator.
 
void Sort ()
 Sort the string list (ascending)
 
int GetCount () const
 Get the number of items in the list.
 
int Remove (const char *S)
 Remove a string from the list.
 
const char * AsString (const char pSeparator='~') const
 Get as string.
 
bool SetString (const char *pString, const char pSeparator='~')
 Set string for list.
 
int Add (const char *S, kReference pRef=0)
 Add a string to the list.
 
void Clear ()
 Clear the list (remove all the items).
 
void RemoveAt (int pIndex)
 Remove an entry at pIndex.
 
int IndexOf (const char *S) const
 Get the index of a string.
 
void InsertAt (int pIndex, const char *S, kReference pRef=0)
 Insert an entry at pIndex.
 
bool SetAt (int pIndex, const char *pString)
 Set the string at pIndex.
 

Protected Attributes

KStringList * mItems
 Internal use only - List of items.
 

Detailed Description

String list.

Definition at line 207 of file fbstring.h.

Constructor & Destructor Documentation

◆ FBStringList() [1/3]

Constructor.

◆ FBStringList() [2/3]

FBStringList ( const char *  pString,
const char  pSeparator = '~' 
)

Constructor.

Parameters
pSeparatorthe string list separator.
pStringString to set for list.

◆ FBStringList() [3/3]

FBStringList ( const FBStringList pOther)

Copy constructor.

◆ ~FBStringList()

Destructor.

Member Function Documentation

◆ Add()

int Add ( const char *  S,
kReference  pRef = 0 
)

Add a string to the list.

Parameters
SString to add to list.
pRefReference to store with string (default = 0)
Returns
Index where item was stored.

◆ AsString()

const char * AsString ( const char  pSeparator = '~') const

Get as string.

Parameters
pSeparatorthe string list separator.
Returns
String list.

◆ Clear()

void Clear ( )

Clear the list (remove all the items).

◆ Find() [1/2]

int Find ( const char *  pString,
bool  pCaseSensitive = true,
bool  pStartWith = false 
) const

Find the index with the string pString (or start with pString)

Parameters
pStringString to search for.
pCaseSensitivetrue if considering case.
pStartWithtrue if to find the index of the string which start with pString.
Returns
Index where S is stored.

◆ Find() [2/2]

int Find ( kReference  pRef) const

Find the index where pRef is stored.

Parameters
pRefReference to look for.
Returns
Index at which pRef can be found.

◆ GetAt()

const char * GetAt ( int  pIndex) const

Get the string at pIndex.

Parameters
pIndexIndex to get string at.
Returns
String at pIndex.

◆ GetCount()

int GetCount ( ) const

Get the number of items in the list.

Returns
Number of strings stored in the list.

◆ GetInternal()

KStringList * GetInternal ( ) const

Get internal variable.

◆ GetReferenceAt()

kReference GetReferenceAt ( int  pIndex) const

Get the reference store with the string at pIndex.

Parameters
pIndexIndex to get reference at.
Returns
Reference stored with value at pIndex.

◆ IndexOf()

int IndexOf ( const char *  S) const

Get the index of a string.

Parameters
SString to look for.
Returns
Index where string S was found.

◆ InsertAt()

void InsertAt ( int  pIndex,
const char *  S,
kReference  pRef = 0 
)

Insert an entry at pIndex.

Parameters
pIndexIndex where item is to be inserted.
SString to insert.
pRefReference to store with string(default=0).

◆ operator=()

FBStringList & operator= ( const FBStringList pOther)

Overload assignment operator to support deep copy.

Parameters
pOtherstring list to be copied from.
Returns
self reference.

◆ operator[]()

const char * operator[] ( int  pIndex) const

Overloaded [] operator.

Returns the string at pIndex.

Parameters
pIndexIndex to access.
Returns
String stored in list at pIndex.

◆ Remove()

int Remove ( const char *  S)

Remove a string from the list.

Parameters
SString to remove from the list.
Returns
Index where item was found.

◆ RemoveAt()

void RemoveAt ( int  pIndex)

Remove an entry at pIndex.

Parameters
pIndexIndex where item is to be removed from.

◆ SetAt()

bool SetAt ( int  pIndex,
const char *  pString 
)

Set the string at pIndex.

Parameters
pIndexIndex where string is to be set.
pStringString to set value at pIndex with.

◆ SetReferenceAt()

void SetReferenceAt ( int  pIndex,
kReference  pRef 
)

Set the reference stored with the string at pIndex.

Parameters
pIndexIndex to store reference at.
pRefReference to store at pIndex.

◆ SetString()

bool SetString ( const char *  pString,
const char  pSeparator = '~' 
)

Set string for list.

Parameters
pSeparatorthe string list separator.
pStringString to set for list.

◆ Sort()

void Sort ( )

Sort the string list (ascending)

Member Data Documentation

◆ mItems

KStringList* mItems
protected

Internal use only - List of items.

Definition at line 211 of file fbstring.h.


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