|
libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
|
Represents a COS-file object. More...
#include <art/paperback/carousel/object.hxx>
Public Member Functions | |
| Object (Undefined const &) | |
| Constructor. | |
| Object (Array) | |
| Constructor. | |
| Object (Boolean) | |
| Constructor. | |
| Object (Dictionary) | |
| Constructor. | |
| Object (Integer) | |
| Constructor. | |
| Object (Name) | |
| Constructor. | |
| Object (Real) | |
| Constructor. | |
| Object (Text) | |
| Constructor. | |
| Object (Object const &) | |
| Constructor. | |
| Object (Object &&) | |
| Constructor. | |
| void | attach (Object_model::Owner &) |
| Attach object to owner. | |
| bool | is_reference () const |
| Check if the objcet is a reference. | |
| Identity const & | identity () const |
| Get object identity, if reference. | |
| Object & | operator= (Object const &) |
| Assignment. | |
| Object & | operator= (Object &&) |
| Assignment. | |
| bool | operator== (Object const &) const |
| Comparison. | |
| bool | operator!= (Object const &) const |
| Comparison. | |
Private Member Functions | |
| Object (shared_ptr< Object_model::Abstract >) | |
| Constructor. | |
| Object_model::Container_base & | container () |
| Get the container of the object. | |
| Object_model::Container_base const & | container () const |
| Get the container of the object. | |
Private Attributes | |
| friend | File |
| friend | Writer |
| shared_ptr< Object_model::Abstract > | _data |
| Holds the data of the object, either an instance of Object_model::Reference for references, or an instance of Object_model::Container for direct objects. | |
Friends | |
| template<typename> | |
| bool | is_of_type (Object const &object) |
| Check object type. | |
| template<typename T> | |
| T & | object_cast (Object &object) |
| This function provides access to the value of an object. | |
| template<typename T> | |
| T const & | object_cast (Object const &object) |
| This function provides access to the value of an object. | |
| Object | clone (Object &object) |
| Clone an object. | |
| void | accept (Object &visitee, Visitor &v) |
| Accept visitor on object. | |
| void | accept (Object const &visitee, Visitor &v) |
| Accept visitor on object. | |
Represents a COS-file object.
The Object class represents a COS-file object.
An object can be either a direct object or an indirect object. The eight supported object types are:
See Section 3.2, "Objects" in the PDF-1.4 specification for further information.
Instances of Object maintain a pointer to the underlying data. Copying an object creates a new reference to the same underlying data. This is not to be confused with indirect COS objects. See the example below for clarification. Also note, that an object can only have a maximum of one owner, so adding an object to say two different arrays at the same time will result in an exception being thrown.
Access to the data of an object is provided by the object_cast function, see the example below:
| Art::Paperback::Carousel::Object::Object | ( | Undefined const & | undefined | ) |
Constructor.
This constructor creates a null (undefined) object.
| Art::Paperback::Carousel::Object::Object | ( | Array | array | ) |
Constructor.
This constructor creates an array object.
| array | The array. |
| Art::Paperback::Carousel::Object::Object | ( | Boolean | boolean | ) |
Constructor.
This constructor creates a boolean object.
| boolean | The boolean value. |
| Art::Paperback::Carousel::Object::Object | ( | Dictionary | dictionary | ) |
Constructor.
This constructor creates a dictionary object.
| dictionary | The dictionary. |
| Art::Paperback::Carousel::Object::Object | ( | Integer | integer | ) |
Constructor.
This constructor creates an integer object.
| integer | The integer value. |
| Art::Paperback::Carousel::Object::Object | ( | Name | name | ) |
Constructor.
This constructor creates a name object.
| name | The name. |
| Art::Paperback::Carousel::Object::Object | ( | Real | real | ) |
Constructor.
This constructor creates a real object.
| real | The real value. |
| Art::Paperback::Carousel::Object::Object | ( | Text | text | ) |
Constructor.
This constructor creates a text (string) object.
| text | The text (string) value. |
| Art::Paperback::Carousel::Object::Object | ( | Object const & | other | ) |
Constructor.
| other | The object to copy from. |
| Art::Paperback::Carousel::Object::Object | ( | Object && | other | ) |
Constructor.
This constructor makes a copy of other rather than moving from it.
This avoids the problem of having invalid-state objects.
| other | The object to move from. |
|
explicitprivate |
Constructor.
This is an internal constructor to create an indirect object.
| void Art::Paperback::Carousel::Object::attach | ( | Object_model::Owner & | owner | ) |
Attach object to owner.
| owner | The owner to tie this object with. |
| bool Art::Paperback::Carousel::Object::is_reference | ( | ) | const |
Check if the objcet is a reference.
| Identity const & Art::Paperback::Carousel::Object::identity | ( | ) | const |
Get object identity, if reference.
| Internal_error | Thrown if the object is not an indirect object. |
Assignment.
| other | The object to assign from. |
Assignment.
| other | The object to assign from. |
| bool Art::Paperback::Carousel::Object::operator== | ( | Object const & | other | ) | const |
Comparison.
| other | The object to compare with. |
| bool Art::Paperback::Carousel::Object::operator!= | ( | Object const & | other | ) | const |
Comparison.
| other | The object to compare with. |
|
private |
Get the container of the object.
|
private |
Get the container of the object.
|
friend |
Check object type.
|
friend |
This function provides access to the value of an object.
|
friend |
This function provides access to the value of an object.
Accept visitor on object.
| visitee | The visitee. |
| v | The visitor. |
Accept visitor on object.
| visitee | The visitee. |
| v | The visitor. |
|
private |
Holds the data of the object, either an instance of Object_model::Reference for references, or an instance of Object_model::Container for direct objects.