#include <StringList.h>
This class should be used with TecUtil functions that use the StringList_pa type.
Public Member Functions | |
StringList () | |
Create an empty StringList object. | |
StringList (StringList_pa stringList) | |
Create a StringList object. | |
StringList (const StringList &stringList) | |
Create a StringList object. | |
StringList (const char *first,...) | |
Create a StringList object. | |
virtual | ~StringList () |
virtual bool | operator== (const StringList &rhs) const |
virtual bool | operator!= (const StringList &rhs) const |
virtual void | append (const StringList &stringList) |
Append the contents of the supplied StringList to this StringList. | |
virtual void | append (const char *strValue) |
Append a string to the string list. | |
virtual void | append (std::string strValue) |
virtual void | clear () |
Remove all contents of the string list. | |
virtual void | assign (const StringList &stringList) |
Copy the contents of the specified string list to this string list. | |
virtual void | assign (const char *strValue, const char *delimiters=",", bool discardEmptyStrings=false) |
Split the supplied string according to the delimiters and populate the StringList with the results. | |
virtual void | assign (std::string strValue, std::string delimiters=",", bool discardEmptyStrings=false) |
virtual void | insert (LgIndex_t index, const char *strValue) |
Insert a copy of the string into the nth position of the string list. | |
virtual void | insert (LgIndex_t index, std::string strValue) |
virtual void | replace (LgIndex_t index, const char *strValue) |
Place a copy of the specified string at the nth position in the string list. | |
virtual void | replace (LgIndex_t index, std::string strValue) |
virtual void | remove (LgIndex_t index) |
Remove the string at the specified index. | |
virtual void | remove (LgIndex_t index, LgIndex_t count) |
Remove the specified number of strings beginning at the nth string. | |
virtual void | sort (const StringListStringComparator_pf comparator=NULL, const ArbParam_t clientData=0) |
Sorts the string list by repeatedly calling the 'Comparator' function until the list is in order. | |
virtual LgIndex_t | size () const |
Count the number of strings currently maintained by the string list. | |
virtual const char * | getStringRef (LgIndex_t index) const |
Return a reference to the nth string in a string list. | |
virtual std::string | get (LgIndex_t index) const |
Return a copy of the the nth string in a string list. | |
virtual std::string | toString (const char *delimiters) const |
Convert a StringList to a single string, using the specified delimiter. | |
virtual std::string | toString (std::string delimiters) const |
virtual StringList_pa | getRef () const |
Get a reference to the StringList_pa maintained by the StringList object. |
tecplot::toolbox::StringList::StringList | ( | ) |
Create an empty StringList object.
OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be allocated. |
tecplot::toolbox::StringList::StringList | ( | StringList_pa | stringList | ) | [explicit] |
Create a StringList object.
stringList | A valid StringList_pa which contains zero or more items. |
OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be allocated. |
tecplot::toolbox::StringList::StringList | ( | const StringList & | stringList | ) |
Create a StringList object.
stringList | A valid StringList object which contains zero or more items. |
OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be allocated. |
tecplot::toolbox::StringList::StringList | ( | const char * | first, | |
... | ||||
) | [explicit] |
Create a StringList object.
first | The first of any number of strings. The final string must be NULL to signify the final string. |
OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be allocated. |
virtual tecplot::toolbox::StringList::~StringList | ( | ) | [virtual] |
virtual bool tecplot::toolbox::StringList::operator== | ( | const StringList & | rhs | ) | const [virtual] |
virtual bool tecplot::toolbox::StringList::operator!= | ( | const StringList & | rhs | ) | const [virtual] |
virtual void tecplot::toolbox::StringList::append | ( | const StringList & | stringList | ) | [virtual] |
Append the contents of the supplied StringList to this StringList.
stringList | stringList may contain zero or more items. |
true
if the contents of stringList were appended, false
otherwise.OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be expanded. |
Referenced by tecplot::toolbox::StyleValue::setValue().
virtual void tecplot::toolbox::StringList::append | ( | const char * | strValue | ) | [virtual] |
Append a string to the string list.
strValue | String to append. This value may be NULL or have zero length. |
true
if the string was appended, false
otherwiseOutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be expanded. |
virtual void tecplot::toolbox::StringList::append | ( | std::string | strValue | ) | [inline, virtual] |
virtual void tecplot::toolbox::StringList::clear | ( | ) | [virtual] |
Remove all contents of the string list.
virtual void tecplot::toolbox::StringList::assign | ( | const StringList & | stringList | ) | [virtual] |
Copy the contents of the specified string list to this string list.
stringList | The string list you want to copy. The string list may contain zero or more items. |
true
if the items were copied, false
otherwise.OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be expanded. |
virtual void tecplot::toolbox::StringList::assign | ( | const char * | strValue, | |
const char * | delimiters = "," , |
|||
bool | discardEmptyStrings = false | |||
) | [virtual] |
Split the supplied string according to the delimiters and populate the StringList with the results.
strValue | The delimited string | |
delimiters | A set of zero or more characters representing the possible delimiters. | |
discardEmptyStrings | Set to 'true' if you do not want empty strings included in the resulting StringList. Empty strings may be created when consecutive delimiters exist. |
OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be expanded. |
virtual void tecplot::toolbox::StringList::assign | ( | std::string | strValue, | |
std::string | delimiters = "," , |
|||
bool | discardEmptyStrings = false | |||
) | [inline, virtual] |
virtual void tecplot::toolbox::StringList::insert | ( | LgIndex_t | index, | |
const char * | strValue | |||
) | [virtual] |
Insert a copy of the string into the nth position of the string list.
The string list is shifted and expanded to accomodate the new string.
index | The position at which to place the new string. index must be >= 1 and <= StringList::size(). | |
strValue | The string to insert into the string list. This value may be NULL. |
true
if the string was inserted, false
otherwise.OutOfMemoryException | OutOfMemoryException is thrown if the StringList could not be expanded. |
virtual void tecplot::toolbox::StringList::insert | ( | LgIndex_t | index, | |
std::string | strValue | |||
) | [inline, virtual] |
virtual void tecplot::toolbox::StringList::replace | ( | LgIndex_t | index, | |
const char * | strValue | |||
) | [virtual] |
Place a copy of the specified string at the nth position in the string list.
If the position is beyond the end of the string list, the string list is resized, so that the string references between the last item of the string list in its original state and the last item of the string list in its new state are assigned NULL. If the position is within the boundaries of the original string list, the string at the specified position is replaced by the new value.
index | The position at which to set the string. index must be >= 1. | |
strValue | The string to insert into the string list. This value may be NULL. |
true
if the string value was set, false
otherwise.OutOfMemoryException | OutOfMemoryException is thrown if insufficient memory is available. |
virtual void tecplot::toolbox::StringList::replace | ( | LgIndex_t | index, | |
std::string | strValue | |||
) | [inline, virtual] |
virtual void tecplot::toolbox::StringList::remove | ( | LgIndex_t | index | ) | [virtual] |
Remove the string at the specified index.
The members following the removed item are shifted to fill the vacated space.
index | Index at which you want to remove the string. index must be >= 1 and <= StringList::size() |
Remove the specified number of strings beginning at the nth string.
The members following the items removed are shifted to fill the vacated space.
index | Start position in the string list. index must be >= 1 and <= StringList::size(). | |
count | Number of items to remove from the string list. count must be >= 1, and less than or equal to the number of items remaining, including the string at the start position. |
virtual void tecplot::toolbox::StringList::sort | ( | const StringListStringComparator_pf | comparator = NULL , |
|
const ArbParam_t | clientData = 0 | |||
) | [virtual] |
Sorts the string list by repeatedly calling the 'Comparator' function until the list is in order.
Default parameters may be used to use the default sorting algorithm.
comparator | Function called to compare two string list strings. Use NULL for the default sort. The default sorting handles NULL elements and uses the system's strcmp utility for comparing valid strings elements. | |
clientData | Contextual information that is passed along to the comparator function. Client data isn't used by the default comparator and can be passed any value. For specialized comparator functions the client data is used to hold contextual information so that global variable do not have to be used. |
virtual LgIndex_t tecplot::toolbox::StringList::size | ( | ) | const [virtual] |
Count the number of strings currently maintained by the string list.
Referenced by tecplot::toolbox::StyleValue::getValue(), and tecplot::toolbox::StyleValue::setValue().
virtual const char* tecplot::toolbox::StringList::getStringRef | ( | LgIndex_t | index | ) | const [virtual] |
Return a reference to the nth string in a string list.
index | Position of string for which to obtain a reference. index must be >= 1 and <= StringList::size() |
virtual std::string tecplot::toolbox::StringList::get | ( | LgIndex_t | index | ) | const [virtual] |
Return a copy of the the nth string in a string list.
index | Position of string for which to obtain a copy. index must be >= 1 and <= StringList::size() |
virtual std::string tecplot::toolbox::StringList::toString | ( | const char * | delimiters | ) | const [virtual] |
Convert a StringList to a single string, using the specified delimiter.
delimiters | A series of zero or more characters to be used as a delimiter between the strings of a StringList. |
virtual std::string tecplot::toolbox::StringList::toString | ( | std::string | delimiters | ) | const [inline, virtual] |
virtual StringList_pa tecplot::toolbox::StringList::getRef | ( | ) | const [virtual] |
Get a reference to the StringList_pa maintained by the StringList object.
This type is required when calling certain TecUtil functions such as TecUtilDataSetCreate. This reference must not be deallocated.