PTLib
Version 2.10.10
|
Representation of token (EBNF group, name, iana-token or x-name) More...
#include <vcard.h>
Public Member Functions | |
Token (const char *str=NULL) | |
Token (const PString &str) | |
Token & | operator= (const char *str) |
Assign the C string to the current object. | |
Token & | operator= (const PString &str) |
Assign the string to the current object. | |
virtual void | PrintOn (ostream &strm) const |
Output the string to the specified stream. | |
virtual void | ReadFrom (istream &strm) |
Input the string from the specified stream. | |
![]() | |
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. | |
PCaselessString & | operator= (const std::string &str) |
Assign the string to the current object. | |
PCaselessString & | operator= (char ch) |
Assign the character to the current object. | |
virtual PObject * | Clone () const |
Make a complete duplicate of the string. | |
![]() | |
virtual Comparison | Compare (const PObject &obj) const |
Get the relative rank of the two strings. | |
virtual PINDEX | HashFunction () const |
Calculate a hash value for use in sets and dictionaries. | |
virtual PBoolean | SetSize (PINDEX newSize) |
Set the size of the string. | |
virtual PBoolean | IsEmpty () const |
Determine if the string is empty. | |
virtual PBoolean | MakeUnique () |
Make this instance to be the one and only reference to the container contents. | |
PBoolean | MakeMinimumSize () |
Set the actual memory block array size to the minimum required to hold the current string contents. | |
PINLINE PINDEX | GetLength () const |
Determine the length of the null terminated string. | |
bool | operator! () const |
Determine if the string is NOT empty. | |
bool | operator*= (const PString &str) const |
Compare two strings using case insensitive comparison. | |
bool | operator== (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator!= (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator< (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator> (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator<= (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator>= (const PObject &str) const |
Compare two strings using the PObject::Compare() function. | |
bool | operator*= (const char *cstr) const |
Compare a PString to a C string using a case insensitive compare function. | |
bool | operator== (const char *cstr) const |
Compare a PString to a C string using the Compare() function. | |
bool | operator!= (const char *cstr) const |
Compare a PString to a C string using the PObject::Compare() function. | |
bool | operator< (const char *cstr) const |
Compare a PString to a C string using the PObject::Compare() function. | |
bool | operator> (const char *cstr) const |
Compare a PString to a C string using the PObject::Compare() function. | |
bool | operator<= (const char *cstr) const |
Compare a PString to a C string using the PObject::Compare() function. | |
bool | operator>= (const char *cstr) const |
Compare a PString to a C string using the PObject::Compare() function. | |
Comparison | NumCompare (const PString &str, PINDEX count=P_MAX_INDEX, PINDEX offset=0) const |
Compare a string against a substring of the object. | |
Comparison | NumCompare (const char *cstr, PINDEX count=P_MAX_INDEX, PINDEX offset=0) const |
Compare a string against a substring of the object. | |
PINDEX | Find (char ch, PINDEX offset=0) const |
Locate the position within the string of the character. | |
PINDEX | Find (const PString &str, PINDEX offset=0) const |
Locate the position within the string of the substring. | |
PINDEX | Find (const char *cstr, PINDEX offset=0) const |
PINDEX | FindLast (char ch, PINDEX offset=P_MAX_INDEX) const |
Locate the position of the last matching character. | |
PINDEX | FindLast (const PString &str, PINDEX offset=P_MAX_INDEX) const |
Locate the position of the last matching substring. | |
PINDEX | FindLast (const char *cstr, PINDEX offset=P_MAX_INDEX) const |
Locate the position of the last matching substring. | |
PINDEX | FindOneOf (const PString &set, PINDEX offset=0) const |
Locate the position of one of the characters in the set. | |
PINDEX | FindOneOf (const char *cset, PINDEX offset=0) const |
Locate the position of one of the characters in the set. | |
PINDEX | FindSpan (const PString &set, PINDEX offset=0) const |
Locate the position of character not in the set. | |
PINDEX | FindSpan (const char *cset, PINDEX offset=0) const |
Locate the position of character not in the set. | |
PINDEX | FindRegEx (const PRegularExpression ®ex, PINDEX offset=0) const |
Locate the position within the string of one of the regular expression. | |
PBoolean | FindRegEx (const PRegularExpression ®ex, PINDEX &pos, PINDEX &len, PINDEX offset=0, PINDEX maxPos=P_MAX_INDEX) const |
Locate the position within the string of one of the regular expression. | |
PBoolean | MatchesRegEx (const PRegularExpression ®ex) const |
Return true if the entire string matches the regular expression. | |
void | Replace (const PString &target, const PString &subs, PBoolean all=false, PINDEX offset=0) |
Locate the substring within the string and replace it with the specifed substring. | |
void | Splice (const PString &str, PINDEX pos, PINDEX len=0) |
Splice the string into the current string at the specified position. | |
void | Splice (const char *cstr, PINDEX pos, PINDEX len=0) |
Splice the string into the current string at the specified position. | |
void | Delete (PINDEX start, PINDEX len) |
Remove the substring from the string. | |
PString | operator() (PINDEX start, PINDEX end) const |
Extract a portion of the string into a new string. | |
PString | Left (PINDEX len) const |
Extract a portion of the string into a new string. | |
PString | Right (PINDEX len) const |
Extract a portion of the string into a new string. | |
PString | Mid (PINDEX start, PINDEX len=P_MAX_INDEX) const |
Extract a portion of the string into a new string. | |
PString | LeftTrim () const |
Create a string consisting of all characters from the source string except all spaces at the beginning of the string. | |
PString | RightTrim () const |
Create a string consisting of all characters from the source string except all spaces at the end of the string. | |
PString | Trim () const |
Create a string consisting of all characters from the source string except all spaces at the beginning and end of the string. | |
PString | ToLower () const |
Create a string consisting of all characters from the source string with all upper case letters converted to lower case. | |
PString | ToUpper () const |
Create a string consisting of all characters from the source string with all lower case letters converted to upper case. | |
PStringArray | Tokenise (const PString &separators, PBoolean onePerSeparator=true) const |
Split the string into an array of substrings. | |
PStringArray | Tokenise (const char *cseparators, PBoolean onePerSeparator=true) const |
Split the string into an array of substrings. | |
PStringArray | Lines () const |
Split the string into individual lines. | |
PINLINE | PString () |
Construct an empty string. | |
PINLINE | PString (const PString &str) |
Create a new reference to the specified string. | |
PINLINE | PString (const std::string &str) |
Create a new string from the specified std::string. | |
PString (const char *cstr) | |
Create a string from the C string array. | |
PString (const wchar_t *ustr) | |
Create a string from the UCS-2 string array. | |
PString (const char *cstr, PINDEX len) | |
Create a string from the array. | |
PString (const wchar_t *ustr, PINDEX len) | |
Create a string from the UCS-2 array. | |
PString (const PWCharArray &ustr) | |
Create a string from the UCS-2 array. | |
PString (char ch) | |
Create a string from the single character. | |
PString (short n) | |
Create a string from the integer type. | |
PString (unsigned short n) | |
Create a string from the integer type. | |
PString (int n) | |
Create a string from the integer type. | |
PString (unsigned int n) | |
Create a string from the integer type. | |
PString (long n) | |
Create a string from the integer type. | |
PString (unsigned long n) | |
Create a string from the integer type. | |
PString (PInt64 n) | |
Create a string from the integer type. | |
PString (PUInt64 n) | |
Create a string from the integer type. | |
PString (ConversionType type, const char *str,...) | |
PString (ConversionType type, long value, unsigned base=10) | |
PString (ConversionType type, double value, unsigned places) | |
PString & | operator= (short n) |
Assign a string from the integer type. | |
PString & | operator= (unsigned short n) |
Assign a string from the integer type. | |
PString & | operator= (int n) |
Assign a string from the integer type. | |
PString & | operator= (unsigned int n) |
Assign a string from the integer type. | |
PString & | operator= (long n) |
Assign a string from the integer type. | |
PString & | operator= (unsigned long n) |
Assign a string from the integer type. | |
PString & | operator= (PInt64 n) |
Assign a string from the integer type. | |
PString & | operator= (PUInt64 n) |
Assign a string from the integer type. | |
virtual PString & | MakeEmpty () |
Make the current string empty. | |
PString | operator+ (const PString &str) const |
Concatenate two strings to produce a third. | |
PString | operator+ (const char *cstr) const |
Concatenate a C string to a PString to produce a third. | |
PString | operator+ (char ch) const |
Concatenate a single character to a PString to produce a third. | |
PString & | operator+= (const PString &str) |
Concatenate a string to another string, modifiying that string. | |
PString & | operator+= (const char *cstr) |
Concatenate a C string to a PString, modifiying that string. | |
PString & | operator+= (char ch) |
Concatenate a single character to a PString. | |
PString | operator& (const PString &str) const |
Concatenate two strings to produce a third. | |
PString | operator& (const char *cstr) const |
Concatenate a C string to a PString to produce a third. | |
PString | operator& (char ch) const |
Concatenate a single character to a PString to produce a third. | |
PString & | operator&= (const PString &str) |
Concatenate a string to another string, modifiying that string. | |
PString & | operator&= (const char *cstr) |
Concatenate a C string to a PString, modifiying that string. | |
PString & | operator&= (char ch) |
Concatenate a character to a PString, modifiying that string. | |
PString & | sprintf (const char *cfmt,...) |
Concatenate a formatted output to the string. | |
PString & | vsprintf (const PString &fmt, va_list args) |
Concatenate a formatted output to the string. | |
PString & | vsprintf (const char *cfmt, va_list args) |
Concatenate a formatted output to the string. | |
long | AsInteger (unsigned base=10) const |
Convert the string to an integer value using the specified number base. | |
DWORD | AsUnsigned (unsigned base=10) const |
Convert the string to an integer value using the specified number base. | |
PInt64 | AsInt64 (unsigned base=10) const |
Convert the string to an integer value using the specified number base. | |
PUInt64 | AsUnsigned64 (unsigned base=10) const |
Convert the string to an integer value using the specified number base. | |
double | AsReal () const |
Convert the string to a floating point number. | |
PWCharArray | AsUCS2 () const |
Convert UTF-8 string to UCS-2. | |
PBYTEArray | ToPascal () const |
Convert a standard null terminated string to a "pascal" style string. | |
PString | ToLiteral () const |
Convert the string to C literal string format. | |
operator const unsigned char * () const | |
Get the internal buffer as a pointer to unsigned characters. | |
operator std::string () const | |
Cast the PString to a std::string. | |
![]() | |
PCharArray (PINDEX initialSize=0) | |
Construct a new dynamic array of char. | |
PCharArray (char const *buffer, PINDEX length, PBoolean dynamic=true) | |
Construct a new dynamic array of char. | |
![]() | |
PBaseArray (PINDEX initialSize=0) | |
Construct a new dynamic array of elements of the specified type. | |
PBaseArray (T const *buffer, PINDEX length, PBoolean dynamic=true) | |
Construct a new dynamic array of elements of the specified type. | |
PBoolean | SetAt (PINDEX index, T val) |
Set the specific element in the array. | |
T | GetAt (PINDEX index) const |
Get a value from the array. | |
void | Attach (const T *buffer, PINDEX bufferSize) |
Attach a pointer to a static block to the base array type. | |
T * | GetPointer (PINDEX minSize=0) |
Get a pointer to the internal array and assure that it is of at least the specified size. | |
T | operator[] (PINDEX index) const |
Get a value from the array. | |
T & | operator[] (PINDEX index) |
Get a reference to value from the array. | |
operator T const * () const | |
Get a pointer to the internal array. | |
PBoolean | Concatenate (const PBaseArray &array) |
Concatenate one array to the end of this array. | |
![]() | |
PAbstractArray (PINDEX elementSizeInBytes, PINDEX initialSize=0) | |
Create a new dynamic array of initalSize elements of elementSizeInBytes bytes each. | |
PAbstractArray (PINDEX elementSizeInBytes, const void *buffer, PINDEX bufferSizeInElements, PBoolean dynamicAllocation) | |
Create a new dynamic array of bufferSizeInElements elements of elementSizeInBytes bytes each. | |
void | Attach (const void *buffer, PINDEX bufferSize) |
Attach a pointer to a static block to the base array type. | |
PBoolean | Concatenate (const PAbstractArray &array) |
Concatenate one array to the end of this array. | |
![]() | |
PContainer (PINDEX initialSize=0) | |
Create a new unique container. | |
PContainer (const PContainer &cont) | |
Create a new refernce to container. | |
PContainer & | operator= (const PContainer &cont) |
Assign one container reference to another. | |
virtual | ~PContainer () |
Destroy the container class. | |
virtual PINDEX | GetSize () const |
Get the current size of the container. | |
PBoolean | SetMinSize (PINDEX minSize) |
Set the minimum size of container. | |
PBoolean | IsUnique () const |
Determine if container is unique reference. | |
![]() | |
virtual | ~PObject () |
virtual const char * | GetClass (unsigned ancestor=0) const |
Get the current dynamic type of the object instance. | |
PBoolean | IsClass (const char *cls) const |
virtual PBoolean | InternalIsDescendant (const char *clsName) const |
Determine if the dynamic type of the current instance is a descendent of the specified class. | |
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
Determine the byte wise comparison of two objects. |
Additional Inherited Members | |
![]() | |
typedef const char * | Initialiser |
enum | ConversionType { Pascal, Basic, Literal, Signed, Unsigned, Decimal, Exponent, Printf, NumConversionTypes } |
![]() | |
static PString | Empty () |
Return an empty string. | |
![]() | |
static const char * | Class () |
Get the name of the class as a C string. | |
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size) |
Internal function caled from CompareObjectMemoryDirect() | |
![]() | |
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) | |
![]() | |
PINDEX | elementSize |
Size of an element in bytes. | |
char * | theArray |
Pointer to the allocated block of memory. | |
PBoolean | allocatedDynamically |
Flag indicating the array was allocated on the heap. | |
![]() | |
![]() |
Representation of token (EBNF group, name, iana-token or x-name)
|
inline |
|
inline |
|
inline |
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";
Reimplemented from PCaselessString.
Referenced by operator=().
Assign the string to the current object.
The current instance then becomes another reference to the same string in the str
parameter.
Reimplemented from PCaselessString.
References operator=().
|
virtual |
Output the string to the specified stream.
Reimplemented from PString.
|
virtual |
Input the string from the specified stream.
This will read all characters until a end of line is reached. The end of line itself is not placed in the string, however it is removed from the stream.
Reimplemented from PString.