#include <ustring.h>
Inherited by Libppt::UConstString [private].
Public Member Functions | |
| UString () | |
| UString (char c) | |
| UString (UChar c) | |
| UString (const char *c) | |
| UString (const UChar *c, int length) | |
| UString (UChar *c, int length, bool copy) | |
| UString (const UString &) | |
| ~UString () | |
| UString & | append (const UString &) |
| CString | cstring () const |
| char * | ascii () const |
| UString & | operator= (const char *c) |
| UString & | operator= (const UString &) |
| UString & | operator+= (const UString &s) |
| const UChar * | data () const |
| bool | isNull () const |
| bool | isEmpty () const |
| bool | is8Bit () const |
| int | length () const |
| UChar | operator[] (int pos) const |
| UCharReference | operator[] (int pos) |
| double | toDouble (bool tolerant=false) const |
| unsigned long | toULong (bool *ok=0L) const |
| int | find (const UString &f, int pos=0) const |
| int | rfind (const UString &f, int pos) const |
| UString | substr (int pos=0, int len=-1) const |
Static Public Member Functions | |
| static UString | from (int i) |
| static UString | from (unsigned int u) |
| static UString | from (double d) |
Static Public Attributes | |
| static UString | null |
Friends | |
| class | UCharReference |
| class | UConstString |
| bool | operator== (const UString &, const UString &) |
Detailed Description
Unicode string class.
Definition at line 181 of file kpresenter/powerpoint/libppt/ustring.h.
Constructor & Destructor Documentation
◆ UString() [1/7]
| UString::UString | ( | ) |
Constructs a null string.
Definition at line 275 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [2/7]
|
explicit |
Constructs a string from the single character c.
Definition at line 281 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [3/7]
|
explicit |
Constructs a string from the single character c.
Definition at line 288 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [4/7]
|
explicit |
Constructs a string from a classical zero determined char string.
Definition at line 295 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [5/7]
| UString::UString | ( | const UChar * | c, |
| int | length | ||
| ) |
Constructs a string from an array of Unicode characters of the specified length.
Definition at line 301 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [6/7]
| UString::UString | ( | UChar * | c, |
| int | length, | ||
| bool | copy | ||
| ) |
If copy is false a shallow copy of the string will be created.
That means that the data will NOT be copied and you'll have to guarantee that it doesn't get deleted during the lifetime of the UString object.
Definition at line 308 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ UString() [7/7]
| UString::UString | ( | const UString & | b | ) |
Copy constructor.
Makes a shallow copy only.
Definition at line 319 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ ~UString()
| UString::~UString | ( | ) |
Destructor.
If this handle was the only one holding a reference to the string the data will be freed.
Definition at line 324 of file kpresenter/powerpoint/libppt/ustring.cpp.
Member Function Documentation
◆ append()
Append another string.
Definition at line 370 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ ascii()
| char * UString::ascii | ( | ) | const |
Convert the Unicode string to plain ASCII chars chopping of any higher bytes.
This method should only be used for debugging purposes as it is neither Unicode safe nor free from side effects. In order not to waste any memory the char buffer is static and shared by all UString instances.
Definition at line 387 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ cstring()
| CString UString::cstring | ( | ) | const |
- Returns
- The string converted to the 8-bit string type CString().
Definition at line 382 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ data()
|
inline |
- Returns
- A pointer to the internal Unicode data.
Definition at line 289 of file kpresenter/powerpoint/libppt/ustring.h.
◆ find()
| int UString::find | ( | const UString & | f, |
| int | pos = 0 |
||
| ) | const |
- Returns
- Position of first occurence of f starting at position pos. -1 if the search was not successful.
Definition at line 528 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ from() [1/3]
|
static |
Constructs a string from a double.
Definition at line 345 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ from() [2/3]
|
static |
Constructs a string from an int.
Definition at line 329 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ from() [3/3]
|
static |
Constructs a string from an unsigned int.
Definition at line 337 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ is8Bit()
| bool UString::is8Bit | ( | ) | const |
Use this if you want to make sure that this string is a plain ASCII string.
For example, if you don't want to lose any information when using cstring() or ascii().
- Returns
- True if the string doesn't contain any non-ASCII characters.
Definition at line 426 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ isEmpty()
|
inline |
- Returns
- True if null or zero length.
Definition at line 297 of file kpresenter/powerpoint/libppt/ustring.h.
◆ isNull()
|
inline |
- Returns
- True if null.
Definition at line 293 of file kpresenter/powerpoint/libppt/ustring.h.
◆ length()
|
inline |
- Returns
- The length of the string.
Definition at line 309 of file kpresenter/powerpoint/libppt/ustring.h.
◆ operator+=()
Appends the specified string.
Definition at line 421 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ operator=() [1/2]
| UString & UString::operator= | ( | const char * | c | ) |
Assignment operator.
Definition at line 400 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ operator=() [2/2]
Assignment operator.
Definition at line 412 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ operator[]() [1/2]
| UCharReference UString::operator[] | ( | int | pos | ) |
Writable reference to character at specified position.
Definition at line 444 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ operator[]() [2/2]
| UChar UString::operator[] | ( | int | pos | ) | const |
Const character at specified position.
Definition at line 436 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ rfind()
| int UString::rfind | ( | const UString & | f, |
| int | pos | ||
| ) | const |
- Returns
- Position of first occurence of f searching backwards from position pos. -1 if the search was not successful.
Definition at line 543 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ substr()
| UString UString::substr | ( | int | pos = 0, |
| int | len = -1 |
||
| ) | const |
- Returns
- The sub string starting at position pos and length len.
Definition at line 558 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ toDouble()
| double UString::toDouble | ( | bool | tolerant = false | ) | const |
Attempts an conversion to a number.
Apart from floating point numbers, the algorithm will recognize hexadecimal representations (as indicated by a 0x or 0X prefix) and +/- Infinity. Returns NaN if the conversion failed.
- Parameters
-
tolerant if true, toDouble can tolerate garbage after the number.
Definition at line 450 of file kpresenter/powerpoint/libppt/ustring.cpp.
◆ toULong()
| unsigned long UString::toULong | ( | bool * | ok = 0L | ) | const |
Attempts an conversion to an unsigned long integer.
ok will be set according to the success.
Definition at line 512 of file kpresenter/powerpoint/libppt/ustring.cpp.
Friends And Related Symbol Documentation
◆ UCharReference
|
friend |
Definition at line 183 of file kpresenter/powerpoint/libppt/ustring.h.
◆ UConstString
|
friend |
Definition at line 184 of file kpresenter/powerpoint/libppt/ustring.h.
Member Data Documentation
◆ null
|
static |
Static instance of a null string.
Definition at line 350 of file kpresenter/powerpoint/libppt/ustring.h.
The documentation for this class was generated from the following files:
