|
PoDoFo 0.9.20
|
#include <PdfVariant.h>
Public Member Functions | |
| PdfVariant () | |
| PdfVariant (bool value) | |
| PdfVariant (int64_t value) | |
| PdfVariant (double value) | |
| PdfVariant (const PdfString &str) | |
| PdfVariant (const PdfName &name) | |
| PdfVariant (const PdfReference &ref) | |
| PdfVariant (const PdfArray &arr) | |
| PdfVariant (const PdfDictionary &dict) | |
| PdfVariant (const PdfData &data) | |
| PdfVariant (const PdfVariant &rhs) | |
| const char * | GetDataTypeString () const |
| bool | IsBool () const |
| bool | IsNumber () const |
| bool | IsRealStrict () const |
| bool | IsNumberOrReal () const |
| bool | IsString () const |
| bool | IsName () const |
| bool | IsArray () const |
| bool | IsDictionary () const |
| bool | IsRawData () const |
| bool | IsNull () const |
| bool | IsReference () const |
| std::string | ToString () const |
| bool | GetBool () const |
| int64_t | GetNumberLenient () const |
| int64_t | GetNumber () const |
| double | GetReal () const |
| double | GetRealStrict () const |
| const PdfString & | GetString () const |
| const PdfName & | GetName () const |
| PdfReference | GetReference () const |
| const PdfArray & | GetArray () const |
| const PdfDictionary & | GetDictionary () const |
| void | SetBool (bool value) |
| void | SetNumber (int64_t value) |
| void | SetReal (double value) |
| void | SetName (const PdfName &name) |
| void | SetString (const PdfString &str) |
| void | Write (OutputStream &stream, PdfWriteFlags writeMode, const PdfStatefulEncrypt &encrypt, charbuff &buffer) const |
| PdfVariant & | operator= (const PdfVariant &rhs) |
| bool | operator== (const PdfVariant &rhs) const |
| bool | operator!= (const PdfVariant &rhs) const |
A variant data type which supports all data types supported by the PDF standard. The data can be parsed directly from a string or set by one of the members. One can also convert the variant back to a string after setting the values.
| PdfVariant::PdfVariant | ( | ) |
Construct an empty variant type IsNull() will return true.
| PdfVariant::PdfVariant | ( | bool | value | ) |
Construct a PdfVariant that is a bool.
| value | the boolean value of this PdfVariant |
| PdfVariant::PdfVariant | ( | int64_t | value | ) |
Construct a PdfVariant that is a number.
| value | the value of the number. |
| PdfVariant::PdfVariant | ( | double | value | ) |
Construct a PdfVariant that is a real number.
| value | the value of the real number. |
| PdfVariant::PdfVariant | ( | const PdfString & | str | ) |
Construct a PdfVariant that is a string. The argument string will be escaped where necessary, so it should be passed in unescaped form.
| str | the value of the string |
| PdfVariant::PdfVariant | ( | const PdfName & | name | ) |
Construct a PdfVariant that is a name.
| name | the value of the name |
| PdfVariant::PdfVariant | ( | const PdfReference & | ref | ) |
Construct a PdfVariant that is a name.
| ref | the value of the name |
| PdfVariant::PdfVariant | ( | const PdfArray & | arr | ) |
Construct a PdfVariant object with array data. The variant will automatically get the datatype PdfDataType::Array. This constructor is the fastest way to create a new PdfVariant that is an array.
| arr | a list of variants |
| PdfVariant::PdfVariant | ( | const PdfDictionary & | dict | ) |
Construct a PdfVariant that is a dictionary.
| dict | the value of the dictionary. |
| PdfVariant::PdfVariant | ( | const PdfData & | data | ) |
Construct a PdfVariant that contains raw PDF data.
| rData | raw and valid PDF data. |
| PdfVariant::PdfVariant | ( | const PdfVariant & | rhs | ) |
Constructs a new PdfVariant which has the same contents as rhs.
| rhs | an existing variant which is copied. |
| const PdfArray & PdfVariant::GetArray | ( | ) | const |
Returns the value of the object as array
| bool PdfVariant::GetBool | ( | ) | const |
Get the value if this object is a bool.
| const char * PdfVariant::GetDataTypeString | ( | ) | const |
| const PdfDictionary & PdfVariant::GetDictionary | ( | ) | const |
Returns the dictionary value of this object
| const PdfName & PdfVariant::GetName | ( | ) | const |
| int64_t PdfVariant::GetNumber | ( | ) | const |
Get the value of the object as int64_t
This method throws if the numer is a floating point number
| int64_t PdfVariant::GetNumberLenient | ( | ) | const |
Get the value of the object as int64_t.
This method is lenient and narrows floating point numbers
| double PdfVariant::GetReal | ( | ) | const |
Get the value of the object as a floating point
This method is lenient and returns also strictly integral numbers
| double PdfVariant::GetRealStrict | ( | ) | const |
Get the value of the object as floating point number
This method throws if the numer is integer
| PdfReference PdfVariant::GetReference | ( | ) | const |
Get the reference values of this object.
| const PdfString & PdfVariant::GetString | ( | ) | const |
| bool PdfVariant::IsArray | ( | ) | const |
| bool PdfVariant::IsBool | ( | ) | const |
| bool PdfVariant::IsDictionary | ( | ) | const |
| bool PdfVariant::IsName | ( | ) | const |
| bool PdfVariant::IsNull | ( | ) | const |
| bool PdfVariant::IsNumber | ( | ) | const |
| bool PdfVariant::IsNumberOrReal | ( | ) | const |
| bool PdfVariant::IsRawData | ( | ) | const |
| bool PdfVariant::IsRealStrict | ( | ) | const |
This method strictly check for a floating point number and return false on integer
| bool PdfVariant::IsReference | ( | ) | const |
| bool PdfVariant::IsString | ( | ) | const |
| bool PdfVariant::operator!= | ( | const PdfVariant & | rhs | ) | const |
| PdfVariant & PdfVariant::operator= | ( | const PdfVariant & | rhs | ) |
Assign the values of another PdfVariant to this one.
| rhs | an existing variant which is copied. |
This will set the dirty flag of this object.
| bool PdfVariant::operator== | ( | const PdfVariant & | rhs | ) | const |
Test to see if the value contained by this variant is the same as the value of the other variant.
| void PdfVariant::SetBool | ( | bool | value | ) |
Set the value of this object as bool
| b | the value as bool. |
This will set the dirty flag of this object.
| void PdfVariant::SetName | ( | const PdfName & | name | ) |
Set the name value of this object
| d | the name value |
This will set the dirty flag of this object.
| void PdfVariant::SetNumber | ( | int64_t | value | ) |
Set the value of this object as int64_t
| l | the value as int64_t. |
This will set the dirty flag of this object.
| void PdfVariant::SetReal | ( | double | value | ) |
Set the value of this object as double
| d | the value as double. |
This will set the dirty flag of this object.
| void PdfVariant::SetString | ( | const PdfString & | str | ) |
Set the string value of this object.
| str | the string value |
This will set the dirty flag of this object.
| string PdfVariant::ToString | ( | ) | const |
Converts the current object into a string representation which can be written directly to a PDF file on disc.
| str | the object string is returned in this object. |
| void PdfVariant::Write | ( | OutputStream & | stream, |
| PdfWriteFlags | writeMode, | ||
| const PdfStatefulEncrypt & | encrypt, | ||
| charbuff & | buffer ) const |
Write the complete variant to an output device.
| stream | write the object to this stream |
| writeMode | additional options for writing this object |
| encrypt | an encryption object which is used to encrypt this object or nullptr to not encrypt this object |