PSortedStringList Class Reference

#include <pstring.h>

Inheritance diagram for PSortedStringList:

PSortedList< T > PAbstractSortedList PCollection PContainer PObject List of all members.

Public Member Functions

Overrides from class PObject
virtual void ReadFrom (istream &strm)
Operations
PINDEX AppendString (const PString &str)
PINDEX GetStringsIndex (const PString &str) const
PINDEX GetNextStringsIndex (const PString &str) const

Protected Member Functions

PINDEX InternalStringSelect (const char *str, PINDEX len, Element *thisElement, Element *&lastElement) const

Detailed Description

This is a sorted 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 PAbstractSortedList# and PSortedList# classes and PDECLARE_SORTEDLIST# macro for more information.


Constructor & Destructor Documentation

PSortedStringList::PSortedStringList ( PINDEX  count,
char const *const *  strarr,
PBoolean  caseless = PFalse 
)

Create a PStringArray 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

PSortedStringList::PSortedStringList ( const PString str  ) 

Create a PSortedStringList of length one from the single string.

Parameters:
str  Single string to convert to a list of one.

PSortedStringList::PSortedStringList ( const PStringArray array  ) 

Create a PSortedStringList from the array of strings.

Parameters:
array  Array of strings to convert to list

PSortedStringList::PSortedStringList ( const PStringList list  ) 

Create a PSortedStringList from the list of strings.

Parameters:
list  List of strings to convert to list.

PSortedStringList::PSortedStringList ( PINDEX  count,
char const *const *  strarr,
PBoolean  caseless = PFalse 
)

Create a PStringArray 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

PSortedStringList::PSortedStringList ( const PString str  ) 

Create a PSortedStringList of length one from the single string.

Parameters:
str  Single string to convert to a list of one.

PSortedStringList::PSortedStringList ( const PStringArray array  ) 

Create a PSortedStringList from the array of strings.

Parameters:
array  Array of strings to convert to list

PSortedStringList::PSortedStringList ( const PStringList list  ) 

Create a PSortedStringList from the list of strings.

Parameters:
list  List of strings to convert to list.


Member Function Documentation

virtual void PSortedStringList::ReadFrom ( istream &  strm  )  [virtual]

Input the contents of the object from the stream. This is primarily used by the standard operator>># function.

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

Reimplemented from PObject.

PINLINE PINDEX PSortedStringList::AppendString ( const PString str  ) 

Add a string to the list. This will place the string in the correct position in the sorted list.

Parameters:
str  String to append.

PINLINE PINDEX PSortedStringList::GetStringsIndex ( const PString str  )  const

Get the index of the string with the specified value. A binary search of tree is performed to find the string value.

Parameters:
str  String value to search for.

PINDEX PSortedStringList::GetNextStringsIndex ( const PString str  )  const

Get the index of the next string after specified value. A binary search of tree is performed to find the string greater than or equal to the specified string value.

Parameters:
str  String value to search for.

PINDEX PSortedStringList::InternalStringSelect ( const char *  str,
PINDEX  len,
Element thisElement,
Element *&  lastElement 
) const [protected]


The documentation for this class was generated from the following files:
Generated on Mon Sep 15 01:21:38 2008 for PTLib by  doxygen 1.5.1