mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Code generator (start)
This commit is contained in:
@ -62,6 +62,15 @@ void PDFObjectFactory::endDictionaryItem()
|
||||
std::get<PDFDictionary>(dictionaryItem.object).addEntry(qMove(topItem.itemName), qMove(std::get<PDFObject>(topItem.object)));
|
||||
}
|
||||
|
||||
PDFObject PDFObjectFactory::takeObject()
|
||||
{
|
||||
Q_ASSERT(m_items.size() == 1);
|
||||
Q_ASSERT(m_items.back().type == ItemType::Object);
|
||||
PDFObject result = qMove(std::get<PDFObject>(m_items.back().object));
|
||||
m_items.clear();
|
||||
return result;
|
||||
}
|
||||
|
||||
void PDFObjectFactory::addObject(PDFObject object)
|
||||
{
|
||||
if (m_items.empty())
|
||||
@ -127,4 +136,26 @@ PDFObjectFactory& PDFObjectFactory::operator<<(PDFObjectReference value)
|
||||
return *this;
|
||||
}
|
||||
|
||||
PDFDocumentBuilder::PDFDocumentBuilder() :
|
||||
m_version(1, 7)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PDFDocumentBuilder::PDFDocumentBuilder(const PDFDocument* document) :
|
||||
m_storage(document->getStorage()),
|
||||
m_version(document->getInfo()->version)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PDFDocument PDFDocumentBuilder::build() const
|
||||
{
|
||||
return PDFDocument(PDFObjectStorage(m_storage), m_version);
|
||||
}
|
||||
|
||||
/* START GENERATED CODE */
|
||||
|
||||
/* END GENERATED CODE */
|
||||
|
||||
} // namespace pdf
|
||||
|
Reference in New Issue
Block a user