34 #ifndef PTLIB_STRING_H 35 #define PTLIB_STRING_H 68 #if (defined(_WIN32) || defined(_WIN32_WCE)) && (!defined(_NATIVE_WCHAR_T_DEFINED)) && (!defined(__MINGW32__)) 134 const std::string & str
186 const wchar_t * ustr,
201 const PWCharArray & ustr
333 const std::string & str
998 PINDEX count = P_MAX_INDEX,
1015 PINDEX count = P_MAX_INDEX,
1057 PINDEX offset = P_MAX_INDEX
1063 PINDEX offset = P_MAX_INDEX
1085 PINDEX offset = P_MAX_INDEX
1169 PINDEX maxPos = P_MAX_INDEX
1313 PINDEX len = P_MAX_INDEX
1399 const char * cseparators,
1588 PWCharArray
AsUCS2()
const;
1619 operator const unsigned char *()
const;
1623 operator std::string ()
const 1630 const wchar_t * ptr,
1657 string.PrintOn(stream);
1664 return stream << (
const char *)
string;
1669 class PWideString :
public PWCharArray {
1676 PWideString(
const PWCharArray & arr) : PWCharArray(arr) { }
1677 PWideString(
const PString & str) : PWCharArray(str.
AsUCS2()) { }
1678 PWideString(
const char * str) : PWCharArray(
PString(str).
AsUCS2()) { }
1679 PWideString &
operator=(
const PWideString & str) { PWCharArray::operator=(str);
return *
this; }
1681 PWideString &
operator=(
const std::string & str) { PWCharArray::operator=(
PString(str.c_str()).
AsUCS2());
return *
this; }
1682 PWideString &
operator=(
const char * str) { PWCharArray::operator=(
PString(str).
AsUCS2());
return *
this; }
1683 friend inline ostream &
operator<<(ostream & stream,
const PWideString &
string) {
return stream <<
PString(
string); }
1690 typedef PWideString PVarString;
1736 const std::string & str
1759 const std::string & str
1833 template <
class ParentString>
1840 : ParentString(m_staticReference)
1841 , m_staticReference((PINDEX)strlen(init)+1, true)
1853 : ParentString(m_staticReference)
1854 , m_staticReference(0,
true)
1895 PINDEX fixedBufferSize
1992 class Buffer :
public streambuf {
1995 Buffer(
const Buffer & sbuf);
1996 Buffer &
operator=(
const Buffer & sbuf);
1997 virtual int_type overflow(int_type = EOF);
1998 virtual int_type underflow();
2000 virtual pos_type seekoff(off_type, ios_base::seekdir, ios_base::openmode = ios_base::in | ios_base::out);
2001 virtual pos_type seekpos(pos_type, ios_base::openmode = ios_base::in | ios_base::out);
2023 #ifdef DOC_PLUS_PLUS 2036 char const *
const * strarr,
2059 const std::vector<PString> & vec
2062 for (std::vector<PString>::const_iterator r = vec.begin(); r != vec.end(); ++r)
2070 const std::vector<std::string> & vec
2073 for (std::vector<std::string>::const_iterator r = vec.begin(); r != vec.end(); ++r)
2080 template <
typename stlContainer>
2082 const stlContainer & vec
2086 for (
typename stlContainer::const_iterator r = vec.begin(); r != vec.end(); ++r)
2114 PINDEX GetStringsIndex(
2135 PINDEX AppendString(
2164 char ** ToCharArray(
2183 #ifdef DOC_PLUS_PLUS 2194 char const *
const * strarr,
2231 PINDEX AppendString(
2237 PINDEX InsertString(
2245 PINDEX GetStringsIndex(
2270 template <
typename stlContainer>
2272 const stlContainer & vec
2276 for (
typename stlContainer::const_iterator r = vec.begin(); r != vec.end(); ++r)
2295 #ifdef DOC_PLUS_PLUS 2306 char const *
const * strarr,
2344 PINDEX AppendString(
2351 PINDEX GetStringsIndex(
2359 PINDEX GetNextStringsIndex(
2365 PINDEX InternalStringSelect(
2390 #ifdef DOC_PLUS_PLUS 2401 char const *
const * strarr,
2505 {
return (
const PString &)GetRefAt(key); }
2523 return str != NULL ? *str :
PString(dflt);
2536 )
const {
return AbstractContains(key); }
2564 )
const {
return (
PString *)AbstractGetAt(key); }
2593 ) {
return AbstractSetAt(key,
PNEW PString(str)); }
2607 {
return (
const K &)AbstractGetKeyAt(index); }
2621 {
return (
PString &)AbstractGetDataAt(index); }
2644 #define PDECLARE_STRING_DICTIONARY(cls, K) \ 2645 PDECLARE_CLASS(cls, PStringDictionary<K>) \ 2647 cls(int dummy, const cls * c) \ 2648 : PStringDictionary<K>(dummy, c) { } \ 2651 : PStringDictionary<K>() { } \ 2652 virtual PObject * Clone() const \ 2653 { return PNEW cls(0, this); } \ 2668 #define PSTRING_DICTIONARY(cls, K) typedef PStringDictionary<K> cls 2685 #ifdef DOC_PLUS_PLUS 2732 #ifdef DOC_PLUS_PLUS 2783 #ifdef DOC_PLUS_PLUS 2832 char ** ToCharArray(
2891 bool GetBoolean(
const PCaselessString & key,
bool dflt =
false)
const;
2921 void SetReal(
const PCaselessString & key,
double value,
int decimals);
2925 __inline
bool Has(
const char * key)
const {
return Contains(key); }
2926 __inline
bool Has(
const PString & key)
const {
return Contains(key); }
2931 __inline
PString Get(
const char * key,
const char * dflt = NULL)
const {
return GetString(key, dflt); }
2932 __inline
PString Get(
const PString & key,
const char * dflt = NULL)
const {
return GetString(key, dflt); }
2947 __inline
void Remove(
const char * key) { RemoveAt(key); }
2986 NotBeginningOfLine = 1,
2998 int flags = IgnoreCase
3004 const char * cpattern,
3005 int flags = IgnoreCase
3106 int flags = IgnoreCase
3116 const char * cpattern,
3117 int flags = IgnoreCase
3233 #endif // PTLIB_STRING_H const char * value
String value for ordinal.
Definition: pstring.h:2697
bool operator!() const
Determine if the string is NOT empty.
void SetReal(const PString &key, double value, int decimals)
Definition: pstring.h:2920
virtual PObject * Clone() const
Make a complete duplicate of the dictionary.
Definition: pstring.h:2486
virtual void PrintOn(ostream &strm) const
Output the string to the specified stream.
PString * RemoveAt(const PString &key)
Definition: pstring.h:2872
double GetReal(const PString &key, double dflt=0) const
Definition: pstring.h:2914
virtual PBoolean IsEmpty() const
Determine if the string is empty.
__inline void Remove(const char *key)
Remove option value.
Definition: pstring.h:2947
__inline bool Has(const PString &key) const
Definition: pstring.h:2926
void SetBoolean(const PCaselessString &(*key)(), bool value)
Definition: pstring.h:2898
Trailing backslash.
Definition: pstring.h:3053
Not implemented.
Definition: pstring.h:3049
friend PString pvsprintf(const char *cfmt, va_list args)
Produce formatted output as a string.
void Destruct()
Internal function called from container destructors.
PString & operator=(const PString &str)
Assign the string to the current object.
PString ToUpper() const
Create a string consisting of all characters from the source string with all lower case letters conve...
virtual Comparison InternalCompare(PINDEX offset, char c) const
PINDEX Find(char ch, PINDEX offset=0) const
Locate the position within the string of the character.
PString & operator &=(const PString &str)
Concatenate a string to another string, modifiying that string.
double GetReal(const PCaselessString &(*key)(), double dflt=0) const
Definition: pstring.h:2916
Array of characters.
Definition: array.h:551
bool Contains(const PCaselessString &(*key)()) const
Definition: pstring.h:2856
This template class maps the PAbstractDictionary to a specific key type and a PString data type...
Definition: pstring.h:2463
PINDEX value
Ordinal value for string.
Definition: pstring.h:2744
Invalid character class name.
Definition: pstring.h:3051
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
bool GetBoolean(const char *key, bool dflt=false) const
Get the option value as a boolean.
Definition: pstring.h:2889
PBoolean SetAt(const PCaselessString &key, const PString &data)
Definition: pstring.h:2867
PStringOptions()
Definition: pstring.h:2848
bool operator<(const PObject &str) const
Compare two strings using the PObject::Compare() function.
static PStringList container(const stlContainer &vec)
Create a PStringArray from an STL container.
Definition: pstring.h:2271
PString operator()(const K &key, const char *dflt=NULL) const
Get the string contained in the dictionary at the key position.
Definition: pstring.h:2520
void * expression
Definition: pstring.h:3228
__inline bool Set(const PCaselessString &key, const PString &value)
Definition: pstring.h:2943
__inline bool Has(const PCaselessString &(*key)()) const
Definition: pstring.h:2928
#define PAssertAlways(msg)
This macro is used to assert immediately.
Definition: object.h:229
__inline PString Get(const PCaselessString &key, const PString &dflt) const
Definition: pstring.h:2937
bool operator*=(const PString &str) const
Compare two strings using case insensitive comparison.
PINDEX key
Ordinal key for string.
Definition: pstring.h:2695
__inline PString Get(const PCaselessString &key, const char *dflt=NULL) const
Definition: pstring.h:2933
virtual PString & MakeEmpty()
Make the current string empty.
Structure for static array initialiser for class.
Definition: pstring.h:2740
#define PINLINE
Definition: object.h:127
T operator[](PINDEX index) const
Get a value from the array.
Definition: array.h:382
This class is a standard C++ stream class descendent for reading or writing streamed data to or from ...
Definition: pstring.h:1878
Definition: pstring.h:290
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.
ErrorCodes
Error codes.
Definition: pstring.h:3039
Definition: pstring.h:284
PString & sprintf(const char *cfmt,...)
Concatenate a formatted output to the string.
bool operator==(const PObject &str) const
Compare two strings using the PObject::Compare() function.
PINDEX AppendString(const PString &str)
Append a string to the array.
This is a dictionary collection class of PString objects, keyed by another string.
Definition: pstring.h:2784
PBoolean SetAt(PINDEX index, T val)
Set the specific element in the array.
Definition: array.h:316
PContainer & operator=(const PContainer &cont)
Assign one container reference to another.
Invalid back reference.
Definition: pstring.h:3055
const char * key
String key for string.
Definition: pstring.h:2793
Definition: pstring.h:287
Comparison
Result of the comparison operation performed by the Compare() function.
Definition: object.h:1184
PString(PContainerReference &reference)
Definition: pstring.h:1651
bool GetBoolean(const PCaselessString &(*key)(), bool dflt=false) const
Definition: pstring.h:2892
Premature end.
Definition: pstring.h:3073
PUInt64 AsUnsigned64(unsigned base=10) const
Convert the string to an integer value using the specified number base.
This class is a variation of a string that ignores case.
Definition: pstring.h:1708
An abstract dictionary container.
Definition: dict.h:626
__inline bool Set(const PCaselessString &(*key)(), const PString &value)
Definition: pstring.h:2944
PStringOptions & operator=(const PStringToString &other)
Definition: pstring.h:2850
PBoolean SetAt(const PString &key, const PString &data)
Definition: pstring.h:2866
__inline PString Get(const char *key, const char *dflt=NULL) const
Get the option value.
Definition: pstring.h:2931
virtual PBoolean SetSize(PINDEX)
Definition: pstring.h:1847
T GetAt(PINDEX index) const
Get a value from the array.
Definition: array.h:329
PBoolean SetAt(const PCaselessString &(*key)(), const PString &data)
Definition: pstring.h:2868
PStringArray Lines() const
Split the string into individual lines.
#define PDECLARE_ARRAY(cls, T)
Begin declaration an array to a specific type of object.
Definition: array.h:1099
PString Right(PINDEX len) const
Extract a portion of the string into a new string.
bool operator>=(const PObject &str) const
Compare two strings using the PObject::Compare() function.
PBoolean SetAt(const char *key, const PString &data)
Definition: pstring.h:2865
PString GetString(const PCaselessString &(*key)(), const char *dflt=NULL) const
Definition: pstring.h:2880
bool Contains(const PString &key) const
Definition: pstring.h:2854
This is an array collection class of PString objects.
Definition: pstring.h:2024
__inline void Remove(const PCaselessString &key)
Definition: pstring.h:2949
PConstantString< PString > PConstString
Constant PString type. See PConstantString.
Definition: pstring.h:1861
__inline PString Get(const PString &key, const char *dflt=NULL) const
Definition: pstring.h:2932
long GetInteger(const PCaselessString &(*key)(), long dflt=0) const
Definition: pstring.h:2904
int flagsSaved
Definition: pstring.h:3226
PINLINE PString()
Construct an empty string.
PString patternSaved
Definition: pstring.h:3225
PString * RemoveAt(const char *key)
Definition: pstring.h:2871
virtual void ReadFrom(istream &strm)
Input the string from the specified stream.
PString * GetAt(const PCaselessString &key) const
Definition: pstring.h:2861
Unmatched ) or \); not returned from regcomp.
Definition: pstring.h:3077
This template class maps the PAbstractList to a specific object type.
Definition: lists.h:321
void InternalFromUCS2(const wchar_t *ptr, PINDEX len)
virtual PString * RemoveAt(const K &key)
Remove an object at the specified key.
Definition: pstring.h:2549
No preceding re for repetition op.
Definition: pstring.h:3069
PStringOptions(const PStringToString &other)
Definition: pstring.h:2849
BOOL PBoolean
Definition: object.h:102
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.
PString & operator+=(const PString &str)
Concatenate a string to another string, modifiying that string.
This is a dictionary collection class of ordinals keyed by PString objects.
Definition: pstring.h:2733
PBoolean MakeMinimumSize()
Set the actual memory block array size to the minimum required to hold the current string contents...
virtual void AssignContents(const PContainer &c)
Copy the container contents.
Array of unsigned characters.
Definition: array.h:670
PString ToLiteral() const
Convert the string to C literal string format.
__inline void Remove(const PString &key)
Definition: pstring.h:2948
ConversionType
Definition: pstring.h:281
virtual PBoolean SetDataAt(PINDEX index, const PString &str)
Set the data at the specified ordinal index position in the dictionary.
Definition: pstring.h:2574
Specialised version of PStringToString to contain a dictionary of options/attributes.
Definition: pstring.h:2845
PInt64 AsInt64(unsigned base=10) const
Convert the string to an integer value using the specified number base.
const K & GetKeyAt(PINDEX index) const
Get the key in the dictionary at the ordinal index position.
Definition: pstring.h:2606
This is a sorted list collection class of PString objects.
Definition: pstring.h:2296
#define PDECLARE_STRING_DICTIONARY(cls, K)
Begin declaration of a dictionary of strings class.
Definition: pstring.h:2644
__inline PString Get(const PCaselessString &(*key)(), const PString &dflt) const
Definition: pstring.h:2938
void SetBoolean(const char *key, bool value)
Set the option value as a boolean.
Definition: pstring.h:2895
Create a constant string.
Definition: pstring.h:1834
Definition: pstring.h:285
char * theArray
Pointer to the allocated block of memory.
Definition: array.h:245
Definition: pstring.h:289
long GetInteger(const PString &key, long dflt=0) const
Definition: pstring.h:2902
bool GetBoolean(const PString &key, bool dflt=false) const
Definition: pstring.h:2890
__inline bool Set(const char *key, const PString &value)
Set the option value.
Definition: pstring.h:2941
const char * value
String value for string.
Definition: pstring.h:2795
PWCharArray AsUCS2() const
Convert UTF-8 string to UCS-2.
virtual PBoolean MakeUnique()
Make this instance to be the one and only reference to the container contents.
__inline bool Has(const char *key) const
Determine of the option exists.
Definition: pstring.h:2925
virtual PBoolean SetDataAt(PINDEX index, PObject *obj)
Set the data at the specified ordinal index position in the dictionary.
PCaselessString(PContainerReference &reference)
Definition: pstring.h:1814
friend ostream & operator<<(ostream &strm, const PObject &obj)
Global function for using the standard << operator on objects descended from PObject.
Definition: object.h:1310
PStringArray(const std::vector< PString > &vec)
Create a PStringArray from a vector of PStrings.
Definition: pstring.h:2058
PStringDictionary()
Create a new, empty, dictionary.
Definition: pstring.h:2476
PBYTEArray ToPascal() const
Convert a standard null terminated string to a "pascal" style string.
PString LeftTrim() const
Create a string consisting of all characters from the source string except all spaces at the beginnin...
Definition: pstring.h:282
Structure for static array initialiser for class.
Definition: pstring.h:2791
void Splice(const PString &str, PINDEX pos, PINDEX len=0)
Splice the string into the current string at the specified position.
PString operator &(const PString &str) const
Concatenate two strings to produce a third.
Invalid range end.
Definition: pstring.h:3065
PString ToLower() const
Create a string consisting of all characters from the source string with all upper case letters conve...
PINDEX FindRegEx(const PRegularExpression ®ex, PINDEX offset=0) const
Locate the position within the string of one of the regular expression.
void Delete(PINDEX start, PINDEX len)
Remove the substring from the string.
This template class maps the PAbstractSet to a specific object type.
Definition: dict.h:455
PStringArray Tokenise(const PString &separators, PBoolean onePerSeparator=true) const
Split the string into an array of substrings.
PString Mid(PINDEX start, PINDEX len=P_MAX_INDEX) const
Extract a portion of the string into a new string.
#define PDECLARE_SET(cls, T, initDelObj)
Begin declaration of a set class.
Definition: dict.h:604
PString & operator=(const std::string &str)
Assign the string to the current object.
Definition: pstring.h:332
PINDEX AppendString(const PString &str)
Append a string to the list.
double AsReal() const
Convert the string to a floating point number.
__inline bool Set(const PString &key, const PString &value)
Definition: pstring.h:2942
The character string class.
Definition: pstring.h:108
bool SetString(const char *key, const PString &value)
Set the option value.
Definition: pstring.h:2883
This is a set collection class of PString objects.
Definition: pstring.h:2391
DWORD AsUnsigned(unsigned base=10) const
Convert the string to an integer value using the specified number base.
PString pvsprintf(const char *fmt, va_list arg)
The same as the standard C vsnprintf(fmt, 1000, va_list arg), but returns a PString instead of a cons...
PString RightTrim() const
Create a string consisting of all characters from the source string except all spaces at the end of t...
Unmatched left bracket.
Definition: pstring.h:3057
virtual Comparison Compare(const PObject &obj) const
Get the relative rank of the two strings.
const char * Initialiser
Definition: pstring.h:115
static PString Empty()
Return an empty string.
const char * key
String key for ordinal.
Definition: pstring.h:2742
virtual void DestroyReference()
Definition: pstring.h:1849
bool deleteObjects
Definition: contain.h:72
PString * RemoveAt(const PCaselessString &key)
Definition: pstring.h:2873
virtual PBoolean SetAt(const K &key, const PString &str)
Add a new object to the collection.
Definition: pstring.h:2590
PBoolean Contains(const K &key) const
Determine if the value of the object is contained in the hash table.
Definition: pstring.h:2534
Invalid pattern.
Definition: pstring.h:3047
PString & GetDataAt(PINDEX index) const
Get the data in the dictionary at the ordinal index position.
Definition: pstring.h:2620
PCaselessString & operator=(const std::string &str)
Assign the string to the current object.
Definition: pstring.h:1758
PStringDictionary(int dummy, const PStringDictionary *c)
Definition: pstring.h:2625
void SetBoolean(const PCaselessString &key, bool value)
Definition: pstring.h:2897
Abstract class to embody the base functionality of a container.
Definition: contain.h:104
This is a list collection class of PString objects.
Definition: pstring.h:2184
PString GetString(const char *key, const char *dflt=NULL) const
Get an option value.
Definition: pstring.h:2877
Definition: pstring.h:286
long AsInteger(unsigned base=10) const
Convert the string to an integer value using the specified number base.
PString operator()(PINDEX start, PINDEX end) const
Extract a portion of the string into a new string.
Definition: pstring.h:288
__inline PString Get(const PString &key, const PString &dflt) const
Definition: pstring.h:2936
__inline PString Get(const PCaselessString &(*key)(), const char *dflt=NULL) const
Definition: pstring.h:2934
void SetReal(const PCaselessString &(*key)(), double value, int decimals)
Definition: pstring.h:2922
PBASEARRAY(PWCharArray, wchar_t)
const PString & GetPattern() const
Return the string which represents the pattern matched by the regular expression. ...
Definition: pstring.h:3098
virtual PINDEX HashFunction() const
Calculate a hash value for use in sets and dictionaries.
This template class maps the PAbstractSortedList to a specific object type.
Definition: lists.h:954
void SetBoolean(const PString &key, bool value)
Definition: pstring.h:2896
bool SetString(const PCaselessString &(*key)(), const PString &value)
Definition: pstring.h:2886
PINDEX FindOneOf(const PString &set, PINDEX offset=0) const
Locate the position of one of the characters in the set.
void SetReal(const char *key, double value, int decimals)
Set a floating point real value for the particular MIME info field.
Definition: pstring.h:2919
Invalid parameter was passed to a function.
Definition: object.h:159
~PConstantString()
Definition: pstring.h:1845
Didn't find a match (for regexec).
Definition: pstring.h:3043
PString * GetAt(const PCaselessString &(*key)()) const
Definition: pstring.h:2862
PConstantString(typename ParentString::Initialiser init)
Definition: pstring.h:1839
Parenthesis imbalance.
Definition: pstring.h:3059
PString GetString(const PString &key, const char *dflt=NULL) const
Definition: pstring.h:2878
PINDEX FindLast(char ch, PINDEX offset=P_MAX_INDEX) const
Locate the position of the last matching character.
This is a dictionary collection class of PString objects, keyed by an ordinal value.
Definition: pstring.h:2686
bool operator<=(const PObject &str) const
Compare two strings using the PObject::Compare() function.
PString * GetAt(const char *key) const
Definition: pstring.h:2859
static PStringArray container(const stlContainer &vec)
Create a PStringArray from an STL container.
Definition: pstring.h:2081
void SetInteger(const PCaselessString &(*key)(), long value)
Definition: pstring.h:2910
This template class maps the PArrayObjects to a specific object type.
Definition: array.h:1024
PINDEX FindSpan(const PString &set, PINDEX offset=0) const
Locate the position of character not in the set.
PConstantString< PCaselessString > PConstCaselessString
Constant PCaselessString type. See PConstantString.
Definition: pstring.h:1864
A class representing a regular expression that may be used for locating patterns in strings...
Definition: pstring.h:2959
#define PDECLARE_LIST(cls, T)
Begin declaration of list class.
Definition: lists.h:455
bool Contains(const char *key) const
Determine if the specified key is present.
Definition: pstring.h:2853
virtual void AssignContents(const PContainer &)
Definition: pstring.h:1848
PStringArray(const std::vector< std::string > &vec)
Create a PStringArray from a vector of std::string.
Definition: pstring.h:2069
Definition: pstring.h:283
PString operator+(const PString &str) const
Concatenate two strings to produce a third.
bool SetString(const PString &key, const PString &value)
Definition: pstring.h:2884
void SetInteger(const char *key, long value)
Set an integer value for the particular MIME info field.
Definition: pstring.h:2907
bool SetString(const PCaselessString &key, const PString &value)
Definition: pstring.h:2885
PString Left(PINDEX len) const
Extract a portion of the string into a new string.
PString * RemoveAt(const PCaselessString &(*key)())
Definition: pstring.h:2874
__inline void Remove(const PCaselessString &(*key)())
Definition: pstring.h:2950
PString Trim() const
Create a string consisting of all characters from the source string except all spaces at the beginnin...
PBoolean MatchesRegEx(const PRegularExpression ®ex) const
Return true if the entire string matches the regular expression.
double GetReal(const char *key, double dflt=0) const
Get the option value as a floating point real.
Definition: pstring.h:2913
bool Contains(const PCaselessString &key) const
Definition: pstring.h:2855
virtual PBoolean SetSize(PINDEX newSize)
Set the size of the string.
ErrorCodes lastError
Definition: pstring.h:3229
PString & vsprintf(const PString &fmt, va_list args)
Concatenate a formatted output to the string.
Unmatched \.
Definition: pstring.h:3061
Invalid contents of \.
Definition: pstring.h:3063
PContainerReference * reference
Definition: contain.h:291
__inline PString Get(const char *key, const PString &dflt) const
Definition: pstring.h:2935
Array of integers.
Definition: array.h:616
PString psprintf(const char *fmt,...)
The same as the standard C snprintf(fmt, 1000, ...), but returns a PString instead of a const char *...
This template class maps the PAbstractDictionary to a specific key type and a POrdinalKey data type...
Definition: dict.h:1039
__inline bool Has(const PCaselessString &key) const
Definition: pstring.h:2927
PString * GetAt(const PString &key) const
Definition: pstring.h:2860
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
Compiled pattern bigger than 2^16 bytes.
Definition: pstring.h:3075
void SetInteger(const PString &key, long value)
Definition: pstring.h:2908
#define PDECLARE_ORDINAL_DICTIONARY(cls, K)
Begin declaration of an ordinal dictionary class.
Definition: dict.h:1214
virtual PObject * Clone() const
Make a complete duplicate of the string.
PINLINE PINDEX GetLength() const
Determine the length of the null terminated string.
#define PNEW
Macro for overriding system default new operator.
Definition: object.h:890
friend PString psprintf(const char *cfmt,...)
Produce formatted output as a string.
long GetInteger(const char *key, long dflt=0) const
Get the option value as an integer.
Definition: pstring.h:2901
PCaselessString(const std::string &str)
Create a caseless string from a std::string.
Definition: pstring.h:1735
Structure for static array initialiser for class.
Definition: pstring.h:2693
virtual PString * GetAt(const K &key) const
Get the object at the specified key position.
Definition: pstring.h:2562
This class is used when an ordinal index value is the key for PSet and PDictionary classes...
Definition: dict.h:50
Ran out of memory.
Definition: pstring.h:3067
Comparison NumCompare(const PString &str, PINDEX count=P_MAX_INDEX, PINDEX offset=0) const
Compare a string against a substring of the object.
const PString & operator[](const K &key) const
Get the string contained in the dictionary at the key position.
Definition: pstring.h:2504
#define PDECLARE_SORTED_LIST(cls, T)
Begin declaration of a sorted list class.
Definition: lists.h:1028