pdfmm 0.9.20
Public Member Functions | List of all members
mm::PdfData Class Referencefinal

#include <PdfData.h>

Inheritance diagram for mm::PdfData:
mm::PdfDataProvider

Public Member Functions

 PdfData (std::string &&data, const std::shared_ptr< size_t > &writeBeacon={ })
 
 PdfData (const std::string_view &data, const std::shared_ptr< size_t > &writeBeacon={ })
 
 PdfData (const PdfData &rhs)
 
void Write (PdfOutputDevice &device, PdfWriteMode writeMode, const PdfEncrypt *encrypt) const override
 
const PdfDataoperator= (const PdfData &rhs)
 
const std::string & data () const
 
virtual void Write (PdfOutputDevice &device, PdfWriteMode writeMode, const PdfEncrypt *encrypt) const =0
 

Additional Inherited Members

- Protected Member Functions inherited from mm::PdfDataProvider
 PdfDataProvider ()
 

Detailed Description

A datatype that allows to write arbitrary data to a PDF file. The user of this class has to ensure that the data written to the PDF file using this class is valid data for a PDF file!

This class is used in pdfmm to pad PdfVariants.

Constructor & Destructor Documentation

◆ PdfData() [1/3]

mm::PdfData::PdfData ( std::string &&  data,
const std::shared_ptr< size_t > &  writeBeacon = { } 
)

Create a new PdfData object with valid PdfData

The contained data has to be a valid value in a PDF file. It will be written directly to the PDF file.

Parameters
writeBeaconShared sentinel that will updated during writing of the document with the current position in the stream

◆ PdfData() [2/3]

mm::PdfData::PdfData ( const std::string_view &  data,
const std::shared_ptr< size_t > &  writeBeacon = { } 
)

Create a new PdfData object with valid PdfData

The contained data has to be a valid value in a PDF file. It will be written directly to the PDF file.

Parameters
writeBeaconShared sentinel that will updated during writing of the document with the current position in the stream

◆ PdfData() [3/3]

PdfData::PdfData ( const PdfData rhs)

Copy an existing PdfData

Parameters
rhsanother PdfData to copy

Member Function Documentation

◆ data()

const std::string & mm::PdfData::data ( ) const
inline

Access the data as a std::string

Returns
a const reference to the contained data

◆ operator=()

const PdfData & PdfData::operator= ( const PdfData rhs)

Copy an existing PdfData

Parameters
rhsanother PdfData to copy
Returns
this object

◆ Write()

void PdfData::Write ( PdfOutputDevice device,
PdfWriteMode  writeMode,
const PdfEncrypt encrypt 
) const
overridevirtual

Write the complete datatype to a file.

Parameters
devicewrite the object to this device
writeModeadditional options for writing this object
encryptan encryption object which is used to encrypt this object or nullptr to not encrypt this object

Implements mm::PdfDataProvider.