class PStringList

This is a list collection class of PString objects.

Inheritance:


Public Methods

[more] Construction
[more] Overrides from class PObject
[more] Operations


Inherited from PList:

Public Methods

New functions for class


Inherited from PAbstractList:

Public Methods

ovirtual Comparison Compare(const PObject & obj) const

Overrides from class PContainer

Overrides from class PCollection

Protected Methods

oPINLINE PObject& GetReferenceAt( PINDEX index ) const
oBOOL SetCurrent( PINDEX index ) const


Inherited from PCollection:

Public Methods

Common functions for collections


Inherited from PContainer:

Public Methods

Common functions for containers

Protected Methods

ovirtual void DestroyContents()
ovirtual void AssignContents(const PContainer & c)
ovoid CopyContents(const PContainer & c)
ovoid CloneContents(const PContainer* src)
ovoid Destruct()


Inherited from PObject:

Public Methods

Run Time Type functions

I/O functions

Miscellaneous functions

Public Members

Comparison functions


Documentation

This is a list collection class of PString objects. It has all the usual functions for a collection, with the object types set to PString pointers.

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 PAbstractList and PList classes and PDECLARE_LIST macro for more information.

o Construction

o PStringList( PINDEX count, char const* const* strarr, BOOL caseless = FALSE )
Create a PStringList from the array of C strings.
Parameters:
- count Count of strings in array
strarr - Array of C strings
caseless - New strings are to be PCaselessStrings

o PStringList( const PString & str )
Create a PStringList of length one from the single string.
Parameters:
- str Single string to convert to a list of one.

o PStringList( const PStringArray & array )
Create a PStringList from the array of strings.
Parameters:
array - Array of strings to convert to list

o PStringList( const PSortedStringList & list )
Create a PStringList from the sorted list of strings.
Parameters:
list - List of strings to convert to list.

o Overrides from class PObject

ovirtual void ReadFrom( istream &strm )
Input the contents of the object from the stream. This is primarily used by the standard operator>> function.

The default behaviour reads '\n' separated strings until !strm.good().

o Operations

oPINDEX AppendString( const PString & str )
Append a string to the list.
Parameters:
- str String to append.

oPINDEX InsertString( const PString & before, const PString & str )
Insert a string into the list.
Parameters:
before - String to insert before.
- str String to insert.

oPINDEX GetStringsIndex( const PString & str ) const
Get the index of the string with the specified value. A linear search of list is performed to find the string value.
Parameters:
- str String value to search for.

oPStringList& operator +=(const PStringList & list)
Concatenate a PString or PStringArray to the list

Returns:
The PStringArray with the new items appended

oPStringList operator + (const PStringList & array)
Create a new PStringList, and add PString or PStringList to it a new PStringList

Returns:
A new PStringList with the additional elements(s)


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.