Public Types | |
enum | Type { e_PageLabels = 1 } |
Enumeration for number tree type. More... | |
Public Member Functions | |
PDFNumberTree (const PDFDoc &document, Type type) | |
Constructor, with parameters. More... | |
PDFNumberTree () | |
Constructor. | |
PDFNumberTree (const PDFNumberTree &other) | |
Constructor, with another PDF number tree object. More... | |
~PDFNumberTree () | |
Destructor. | |
objects::PDFObject * | GetObj (int number) |
Get the value (as PDF object) of a specified key integer. More... | |
Type | GetType () |
Get the type of current number tree. More... | |
bool | HasNumber (int number) |
Check if the specified key integer exists in current number tree. More... | |
bool | IsEmpty () const |
Check whether current object is empty or not. More... | |
bool | operator!= (const PDFNumberTree &other) const |
Not equal operator. More... | |
PDFNumberTree & | operator= (const PDFNumberTree &other) |
Assign operator. More... | |
bool | operator== (const PDFNumberTree &other) const |
Equal operator. More... | |
bool | RemoveAllObjs () |
Remove all key integers from current number tree, along with theirs value (as PDF object). More... | |
bool | RemoveObj (int number) |
Remove a key integer from current number tree, along with its value (as PDF object). More... | |
bool | SetObj (int number, objects::PDFObject *pdf_object) |
Set the value (as PDF object) of a specified key integer. If the key integer does not exist, it will be added to current number tree with the value. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
Number tree is a kind of common data structure in PDF. A number tree is similar to a number tree, except that keys in a number tree are integers instead of strings and are sorted in ascending numerical order. Number tree has following characteristics:
Class PDFNumberTree is used to be associated with an existing number tree with specified type or create one. It offers functions to get key-value pairs in the number tree, and set/add/remove any key-value pair. Currently, class PDFNumberTree can be associated with following number tree defined in PDF document:
Constructor, with parameters.
If there exists number tree with specified type in the PDF document, this function is just to construct a PDF number tree object to be associated with the number tree. If there is no such number tree in PDF document, the constructed PDF number tree object can be used to create such number tree in PDF document and add items to the number tree.
[in] | document | A valid PDF document object. |
[in] | type | The type of the number tree. Please refer to values starting from PDFNumberTree::e_PageLabels and this should be one of these values. |
foxit::pdf::objects::PDFNumberTree::PDFNumberTree | ( | const PDFNumberTree & | other | ) |
Constructor, with another PDF number tree object.
[in] | other | Another PDF number tree object. |
objects::PDFObject* foxit::pdf::objects::PDFNumberTree::GetObj | ( | int | number | ) |
Get the value (as PDF object) of a specified key integer.
[in] | number | An integer as the key. |
Type foxit::pdf::objects::PDFNumberTree::GetType | ( | ) |
Get the type of current number tree.
bool foxit::pdf::objects::PDFNumberTree::HasNumber | ( | int | number | ) |
Check if the specified key integer exists in current number tree.
[in] | number | An integer that represents the key to be checked. |
bool foxit::pdf::objects::PDFNumberTree::IsEmpty | ( | ) | const |
Check whether current object is empty or not.
When the current object is empty, that means current object is useless.
bool foxit::pdf::objects::PDFNumberTree::operator!= | ( | const PDFNumberTree & | other | ) | const |
Not equal operator.
[in] | other | Another PDF number tree object. This function will check if current object is not equal to this one. |
PDFNumberTree& foxit::pdf::objects::PDFNumberTree::operator= | ( | const PDFNumberTree & | other | ) |
Assign operator.
[in] | other | Another PDF number tree object, whose value would be assigned to current object. |
bool foxit::pdf::objects::PDFNumberTree::operator== | ( | const PDFNumberTree & | other | ) | const |
Equal operator.
[in] | other | Another PDF number tree object. This function will check if current object is equal to this one. |
bool foxit::pdf::objects::PDFNumberTree::RemoveAllObjs | ( | ) |
Remove all key integers from current number tree, along with theirs value (as PDF object).
bool foxit::pdf::objects::PDFNumberTree::RemoveObj | ( | int | number | ) |
Remove a key integer from current number tree, along with its value (as PDF object).
If the input key integer does not exist in current number tree, this function will return true directly.
[in] | number | An integer as the key to be removed. |
bool foxit::pdf::objects::PDFNumberTree::SetObj | ( | int | number, |
objects::PDFObject * | pdf_object | ||
) |
Set the value (as PDF object) of a specified key integer. If the key integer does not exist, it will be added to current number tree with the value.
[in] | number | An integer as the key. |
[in] | pdf_object | A PDF object to be set as the key's value. It should not be NULL. The type of this PDF object should match current number tree; otherwise, the input PDF object is invalid. Please refer to comment of class PDFNumberTree for more details. User should not release this PDF object after this function succeeds. |