Maintains a list of pointers to SbString instances. More...
#include <Inventor/lists/SbStringList.h>
Public Member Functions | |
void | append (SbString *string) |
void | append (const char *) |
int | find (SbString *string) |
int | findString (const SbString &string) const |
void | insert (SbString *string, int addBefore) |
SbString *& | operator[] (int i) const |
Static Public Member Functions | |
static SbStringList | split (const SbString &str, const SbString &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
QStringList qlist; qlist<<str1<<str2<<[etc.]; SbStringList slist; for(const QString &str : qlist) slist.append(&(new SbString)->fromWideChar(qstr.toStdWString().c_str()));
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.
Reimplemented from SbPList.
static SbStringList SbStringList::split | ( | const SbString & | str, | |
const SbString & | separator | |||
) | [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. |