Open Inventor Release 2024.1.0
 
Loading...
Searching...
No Matches
SbStringList Class Reference

Maintains a list of pointers to SbString instances. More...

#include <Inventor/lists/SbStringList.h>

+ Inheritance diagram for SbStringList:

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.
 
SbPListoperator= (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.
 

Detailed Description

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.

EXAMPLE

SEE ALSO

SbString

Definition at line 61 of file SbStringList.h.

Member Function Documentation

◆ append() [1/2]

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.

◆ append() [2/2]

void SbStringList::append ( SbString string)

Adds given SbString pointer to end of list.

◆ find()

int SbStringList::find ( SbString string)

Returns index of given SbString in list, or -1 if not found (pointer check)

◆ findString()

int SbStringList::findString ( const SbString string) const

Returns index of given SbString in list, or -1 if not found (string check)

◆ insert()

void SbStringList::insert ( SbString string,
int  addBefore 
)

Inserts given SbString in list before SbString with given index.

◆ operator[]()

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.

◆ split()

static SbStringList SbStringList::split ( const SbString str,
const SbString separator 
)
static

This function splits a string according to a separator.

Parameters
strThe string to split.
separatorThe separator which is used to split the string.
Returns
The list of strings.

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