#include <pstring.h>
Construction | |
PStringArray (PINDEX count, char const *const *strarr, BOOL caseless=FALSE) | |
PStringArray (const PString &str) | |
PStringArray (const PStringList &list) | |
PStringArray (const PSortedStringList &list) | |
PStringArray (const std::vector< PString > &vec) | |
PStringArray (const std::vector< std::string > &vec) | |
template<typename stlContainer> | |
static PStringArray | container (const stlContainer &vec) |
Public Member Functions | |
Overrides from class PObject | |
virtual void | ReadFrom (istream &strm) |
New functions for class | |
PINDEX | GetStringsIndex (const PString &str) const |
PString | operator[] (PINDEX index) const |
PString & | operator[] (PINDEX index) |
PINDEX | AppendString (const PString &str) |
PStringArray & | operator+= (const PStringArray &array) |
PStringArray & | operator+= (const PString &str) |
PStringArray | operator+ (const PStringArray &array) |
PStringArray | operator+ (const PString &str) |
char ** | ToCharArray (PCharArray *storage=NULL) const |
In addition some addition functions are added that take a const PString# reference instead of a pointer as most standard collection functions do. This is more convenient for when string expressions are used as parameters to function in the collection.
See the PAbstractArray# and PArray# classes and PDECLARE_ARRAY# macro for more information.
|
Create a PStringArray from the array of C strings. If count is P_MAX_INDEX then strarr is assumed to point to an array of strings where the last pointer is NULL.
|
|
Create a PStringArray of length one from the single string.
|
|
Create a PStringArray from the list of strings.
|
|
Create a PStringArray from the sorted list strings.
|
|
Create a PStringArray from a vector of PStrings |
|
Create a PStringArray from a vector of std::string |
|
Append a string to the array
|
|
Create a PStringArray from an STL container |
|
As for GetValuesIndex()# but takes a PString argument so that literals will be automatically converted.
|
|
|
|
Create a new PStringArray, and add PString or PStringArray to it a new PStringArray
|
|
|
|
Concatenate a PString or PStringArray to the array
|
|
Retrieve a reference to the object in the array. If there was not an object at that ordinal position or the index was beyond the size of the array then the function will create a new one.
|
|
|
|
Input the contents of the object from the stream. This is primarily used by the standard operator>># function.
The default behaviour reads ' |
|
Create an array of C strings. If storage is NULL then this returns a single pointer that may be disposed of using free(). Note that each of the strings are part of the same memory allocation so only one free() is required. If storage is not null then that is used to allocate the memory. |