Maintains a list of pointers to SbString instances. More...
#include <Inventor/lists/SbStringList.h>
Public Member Functions | |
void | append (SbString *string) |
Adds given SbString pointer to end of list. | |
void | append (const char *) |
Adds given string to the end of the list. | |
int | find (SbString *string) |
Returns index of given SbString in list, or -1 if not found (pointer check) | |
int | findString (const SbString &string) const |
Returns index of given SbString in list, or -1 if not found (string check) | |
void | insert (SbString *string, int addBefore) |
Inserts given SbString in list before SbString with given index. | |
SbString *& | operator[] (int i) const |
Returns pointer with given index. | |
Public Member Functions inherited from SbPList | |
SbPList () | |
Default constructor. | |
SbPList (int initSize) | |
Constructor. | |
SbPList (const SbPList &pl) | |
Constructor. | |
virtual | ~SbPList () |
Destructor. | |
void | append (void *ptr) |
Adds given pointer to end of list. | |
int | find (const void *ptr) const |
Returns index of given pointer in list, or -1 if not found. | |
void | insert (void *ptr, int addBefore) |
Inserts given pointer in list before pointer with given index. | |
virtual void | remove (int which) |
Removes pointer with given index. | |
int | getLength () const |
Returns number of pointers in list. | |
virtual void | truncate (int start) |
Removes all pointers after one with given index, inclusive. | |
void | copy (const SbPList &pl) |
Copies a list. | |
SbPList & | operator= (const SbPList &pl) |
Assignment operator: copies list into this list. | |
void *& | operator[] (const int index) const |
Returns pointer with given index. | |
int | operator== (const SbPList &pl) const |
Equality operator. | |
int | operator!= (const SbPList &pl) const |
Inequality operator. | |
void | swap (int index1, int index2) |
Swaps element having index1 with the one having index2. | |
Static Public Member Functions | |
static SbStringList | split (const SbString &str, const SbString &separator) |
This function splits a string according to a separator. | |
Maintains a list of pointers to SbString instances.
This subclass of SbPList holds a list of SbString pointers.
Note: Because this is a list of pointers, not a list of objects, the destructor for this class does not free the memory associated with the SbString objects. If your application creates or takes ownership of an SbStringList, you are responsible for deleting the SbString objects.
Conversion QStringList -> SbStringList
Definition at line 61 of file SbStringList.h.
void SbStringList::append | ( | const char * | ) |
Adds given string to the end of the list.
A new SbString instance is created and must be deleted by user.
int SbStringList::find | ( | SbString * | string | ) |
Returns index of given SbString in list, or -1 if not found (pointer check)
int SbStringList::findString | ( | const SbString & | string | ) | const |
Returns index of given SbString in list, or -1 if not found (string check)
void SbStringList::insert | ( | SbString * | string, |
int | addBefore | ||
) |
SbString *& SbStringList::operator[] | ( | int | i | ) | const |
Returns pointer with given index.
If requested index does not exists, list is grown to return a valid pointer.
|
static |
This function splits a string according to a separator.
str | The string to split. |
separator | The separator which is used to split the string. |