PTLib  Version 2.10.4
PCaselessString Class Reference

This class is a variation of a string that ignores case. More...

#include <pstring.h>

Inheritance diagram for PCaselessString:
PString PCharArray PBaseArray< T > PAbstractArray PContainer PObject PColourConverterRegistration PvCard::Token PSynonymColourRegistration

List of all members.

Public Member Functions

 PCaselessString ()
 Create a new, empty, caseless string.
 PCaselessString (const char *cstr)
 Create a new caseless string, initialising it to the characters in the C string provided.
 PCaselessString (const PString &str)
 Create a caseless string, with a reference to the characters in the normal PString provided.
 PCaselessString (const std::string &str)
 Create a caseless string from a std::string.
PCaselessStringoperator= (const PString &str)
 Assign the string to the current object.
PCaselessStringoperator= (const std::string &str)
 Assign the string to the current object.
PCaselessStringoperator= (const char *cstr)
 Assign the C string to the current object.
PCaselessStringoperator= (char ch)
 Assign the character to the current object.
virtual PObjectClone () const
 Make a complete duplicate of the string.

Protected Member Functions

virtual Comparison InternalCompare (PINDEX offset, char c) const
virtual Comparison InternalCompare (PINDEX offset, PINDEX length, const char *cstr) const
 PCaselessString (int dummy, const PCaselessString *str)
 PCaselessString (PContainerReference &reference)

Detailed Description

This class is a variation of a string that ignores case.

Thus in all standard comparison (==, < etc) and search (Find() etc) functions the case of the characters and strings is ignored.

The characters in the string still maintain their case. Only the comparison operations are affected. So printing etc will still display the string as entered.


Constructor & Destructor Documentation

Create a new, empty, caseless string.

PCaselessString::PCaselessString ( const char *  cstr)

Create a new caseless string, initialising it to the characters in the C string provided.

Parameters:
cstrC string to initialise the caseless string from.

Create a caseless string, with a reference to the characters in the normal PString provided.

A PCaselessString may also be provided to this constructor.

Parameters:
strString to initialise the caseless string from.
PCaselessString::PCaselessString ( const std::string &  str) [inline]

Create a caseless string from a std::string.

Parameters:
strString to initialise the caseless string from.
PCaselessString::PCaselessString ( int  dummy,
const PCaselessString str 
) [protected]
PCaselessString::PCaselessString ( PContainerReference reference) [inline, protected]

Member Function Documentation

virtual PObject* PCaselessString::Clone ( ) const [virtual]

Make a complete duplicate of the string.

Note that the data in the array of characters is duplicated as well and the new object is a unique reference to that data.

Reimplemented from PString.

virtual Comparison PCaselessString::InternalCompare ( PINDEX  offset,
char  c 
) const [protected, virtual]

Reimplemented from PString.

virtual Comparison PCaselessString::InternalCompare ( PINDEX  offset,
PINDEX  length,
const char *  cstr 
) const [protected, virtual]

Reimplemented from PString.

PCaselessString& PCaselessString::operator= ( const PString str)

Assign the string to the current object.

The current instance then becomes another reference to the same string in the str parameter.

Returns:
reference to the current PString object.
Parameters:
strNew string to assign.

Reimplemented from PString.

Reimplemented in PvCard::Token.

PCaselessString& PCaselessString::operator= ( const std::string &  str) [inline]

Assign the string to the current object.

The current instance then becomes another reference to the same string in the str parameter.

Returns:
reference to the current PString object.
Parameters:
strNew string to assign.

Reimplemented from PString.

References operator=().

Referenced by operator=().

PCaselessString& PCaselessString::operator= ( const char *  cstr)

Assign the C string to the current object.

The current instance then becomes a unique reference to a copy of the cstr parameter. The cstr parameter is typically a literal string, eg:


          myStr = "fred";
Returns:
reference to the current PString object.
Parameters:
cstrC string to assign.

Reimplemented from PString.

Reimplemented in PvCard::Token.

PCaselessString& PCaselessString::operator= ( char  ch)

Assign the character to the current object.

The current instance then becomes a unique reference to a copy of the character parameter. eg:


          myStr = 'A';
Returns:
reference to the current PString object.
Parameters:
chCharacter to assign.

Reimplemented from PString.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines