PoDoFo  1.0.0-dev
PdfFileSpec.h
1 
6 #ifndef PDF_FILE_SPEC_H
7 #define PDF_FILE_SPEC_H
8 
9 #include "PdfDeclarations.h"
10 
11 #include "PdfElement.h"
12 #include "PdfString.h"
13 
14 namespace PoDoFo {
15 
16 class PdfDocument;
17 
23 class PODOFO_API PdfFileSpec final : public PdfDictionaryElement
24 {
25  friend class PdfDocument;
26  friend class PdfAnnotationFileAttachment;
27  friend class PdfNameTreeBase;
28 
29 private:
31 
32  PdfFileSpec(PdfObject& obj);
33 
34  PdfFileSpec(const PdfFileSpec& fileSpec) = default;
35 
36 public:
37  bool TryCreateFromObject(PdfObject& obj, std::unique_ptr<PdfFileSpec>& filespec);
38 
42  nullable<const PdfString&> GetFilename() const;
43 
44  void SetFilename(nullable<const PdfString&> filename);
45 
46  void SetEmbeddedData(nullable<const charbuff&> data);
47 
48  void SetEmbeddedDataFromFile(const std::string_view& filepath);
49 
50  nullable<charbuff> GetEmbeddedData() const;
51 
52 private:
53  void setData(InputStream& stream, size_t size);
54 };
55 
56 };
57 
58 #endif // PDF_FILE_SPEC_H
59 
SPDX-FileCopyrightText: (C) 2005 Dominik Seichter domseichter@web.de SPDX-FileCopyrightText: (C) 2020...
An interface for reading blocks of data from a data source.
Definition: InputStream.h:20
PdfDocument is the core interface for working with PDF documents.
Definition: PdfDocument.h:108
A file specification is used in the PDF file to refer to another file.
Definition: PdfFileSpec.h:24
This class represents a PDF indirect Object in memory.
Definition: PdfObject.h:35
Alternative to std::optional that supports reference (but not pointer) types.
Definition: nullable.h:29
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16