#include <PdfString.h>
Inheritance diagram for PoDoFo::PdfString:
Public Member Functions | |
PdfString () | |
PdfString (const std::string &sString, const PdfEncoding *const pEncoding=NULL) | |
PdfString (const char *pszString, const PdfEncoding *const pEncoding=NULL) | |
PdfString (const wchar_t *pszString) | |
PdfString (const char *pszString, pdf_long lLen, bool bHex=false, const PdfEncoding *const pEncoding=NULL) | |
PdfString (const pdf_utf8 *pszStringUtf8) | |
PdfString (const pdf_utf16be *pszStringUtf16) | |
PdfString (const pdf_utf8 *pszStringUtf8, pdf_long lLen) | |
PdfString (const pdf_utf16be *pszStringUtf16, pdf_long lLen) | |
PdfString (const PdfString &rhs) | |
void | SetHexData (const char *pszHex, pdf_long lLen=-1, PdfEncrypt *pEncrypt=NULL) |
bool | IsValid () const |
bool | IsHex () const |
bool | IsUnicode () const |
const char * | GetString () const |
const pdf_utf16be * | GetUnicode () const |
const std::string & | GetStringUtf8 () const |
pdf_long | GetLength () const |
pdf_long | GetUnicodeLength () const |
pdf_long | GetCharacterLength () const |
void | Write (PdfOutputDevice *pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt *pEncrypt=NULL) const |
const PdfString & | operator= (const PdfString &rhs) |
bool | operator> (const PdfString &rhs) const |
bool | operator< (const PdfString &rhs) const |
bool | operator== (const PdfString &rhs) const |
bool | operator!= (const PdfString &rhs) const |
PdfString | ToUnicode () const |
PdfStrings representing text are either in PDFDocEncoding (ISO Latin1) encoded or UTF-16BE encoded.
PoDoFo contains methods to convert between these encodings. For convinience conversion to UTF-8 is possible to. Please not that strings are always stored as UTF-16BE or ISO Latin1 (PdfDocEncoding) in the PDF file.
UTF-16BE strings have to start with the byts 0xFE 0xFF to be recognized by PoDoFo as unicode strings.
PdfStrings is an implicitly shared class. As a reason it is very fast to copy PdfString objects.
The internal string buffer is guaranteed to be always terminated by 2 zeros.
|
Create an empty and invalid string |
|
Construct a new PdfString from a std::string. The input string will be copied. If the first to bytes of the string are 0xFE and 0xFF this string is treated as UTF-16BE encoded unicode string.
|
|
Construct a new PdfString from a 0 terminated string. The input string will be copied.
|
|
Construct a new PdfString from a 0 terminated string. The input string will be copied.
|
|
Construct a new PdfString from a string. The input string will be copied. If the first to bytes of the string are 0xFE and 0xFF this string is treated as UTF-16BE encoded unicode string.
|
|
Construct a new PdfString from an UTF-8 encoded string. The string is converted to UTF-16BE internally.
|
|
Construct a new PdfString from an UTF-16be encoded zero terminated string.
|
|
Construct a new PdfString from an UTF-8 encoded string. The string is converted to UTF-16BE internally.
|
|
Construct a new PdfString from an UTF-16be encoded zero terminated string.
|
|
Copy an existing PdfString
|
|
Get the number of characters in the string. This function returns the correct number of characters in the string for unicode and ansi strings. Always use this method if you want to know the number of characters in the string as GetLength() will returns the number of bytes used for unicode strings!
|
|
The length of the string data returned by GetString() in bytes not including terminating zeros.
|
|
The contents of the strings can be read by this function. The returned data is never hex encoded may contain 0 bytes. if IsUnicode() returns true, the return value points to a UTF-16BE string buffer with Length() characters. Better use GetUnicode() in this case.
|
|
The contents of the string as UTF8 string. The strings contents are always returned as UTF8 by this function. Works for unicode strings and for non unicode strings. This is the prefered way to access the strings contents.
|
|
The contents of the strings can be read by this function. The returned data is never hex encoded any maycontain 0 bytes. if IsUnicode() returns true, the return value points to a UTF-16BE string buffer with Length() characters. Better use GetUnicode() in this case.
|
|
The length of the string data returned by GetUnicode() in characters not including the terminating zero
|
|
Check if this is a hex string. If true the data will be hex encoded when the string is written to a PDF file.
|
|
PdfStrings are either Latin1 encoded or UTF-16BE encoded unicode strings. This functions returns true if this is a unicode string object.
|
|
The string is valid if no error in the constructor has occurred. If it is valid it is safe to call all the other member functions.
|
|
Comparison operator
|
|
Compare two PdfString objects
|
|
Copy an existing PdfString
|
|
Comparison operator UTF-8 and UTF-16BE encoded strings of the same data compare equal. Whether the string will be written out as hex is not considered - only the real "text" is tested for equality.
|
|
Compare two PdfString objects
|
|
Set hex encoded data as the strings data.
|
|
Converts this string to a unicode string If IsUnicode() returns true a copy of this string is returned otherwise the string data is converted to UTF-16be and returned.
|
|
Write this PdfString in PDF format to a PdfOutputDevice
Implements PoDoFo::PdfDataType. |