libart-paperback 0.1.0-a.1.20260122225059.e5fea306241a
PDF (1.4) library for C++
Art::Paperback::Internals::Page_tree Class Reference

Represents a PDF page tree. More...

#include <art/paperback/internals/page-tree.hxx>

Classes

struct  Create_new
 
struct  Internal
 

Public Member Functions

 Page_tree (Create_new const &, Document_catalog &)
 Constructor.
 
 ~Page_tree () noexcept
 Destructor.
 
Document_catalogdocument_catalog () const
 Access the parent document catalog.
 
Carousel::Object object () const
 Access the associated data object.
 
Pagecreate_page (Page::Properties const &)
 Create a new page and add it to the page tree.
 
Pageget_page (size_t)
 Get page.
 
Page const & get_page (size_t) const
 Get page.
 
void erase_page (size_t)
 Erase page.
 

Static Public Attributes

static constexpr Create_new const create_new {}
 

Private Member Functions

 Page_tree (Page_tree const &)=delete
 
 Page_tree (Page_tree &&)=delete
 
Page_treeoperator= (Page_tree const &)=delete
 
Page_treeoperator= (Page_tree &&)=delete
 

Private Attributes

unique_ptr< Internalinternal
 

Detailed Description

Represents a PDF page tree.

Warning
The current Page_tree implementation maintains a flat array of all pages in the tree. This is far from optimal. We should probably implement a self-balancing tree in the future.

Constructor & Destructor Documentation

◆ Page_tree()

Art::Paperback::Internals::Page_tree::Page_tree ( Create_new const & ,
Document_catalog & document_catalog )

Constructor.

This constructor creates a new page tree.

Parameters
document_catalogThe parent document catalog.

◆ ~Page_tree()

Art::Paperback::Internals::Page_tree::~Page_tree ( )
noexcept

Destructor.

Member Function Documentation

◆ document_catalog()

Document_catalog & Art::Paperback::Internals::Page_tree::document_catalog ( ) const

Access the parent document catalog.

Returns
Returns a reference to the parent document catalog.

◆ object()

Carousel::Object Art::Paperback::Internals::Page_tree::object ( ) const

Access the associated data object.

◆ create_page()

Page & Art::Paperback::Internals::Page_tree::create_page ( Page::Properties const & properties)

Create a new page and add it to the page tree.

Parameters
propertiesThe properties of the new page.

◆ get_page() [1/2]

Page & Art::Paperback::Internals::Page_tree::get_page ( size_t )

Get page.

◆ get_page() [2/2]

Page const & Art::Paperback::Internals::Page_tree::get_page ( size_t ) const

Get page.

◆ erase_page()

void Art::Paperback::Internals::Page_tree::erase_page ( size_t )

Erase page.