File indexing completed on 2025-12-10 10:23:45
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 #ifndef FILE_SPEC_H
0017 #define FILE_SPEC_H
0018
0019 #include "Object.h"
0020 #include "poppler_private_export.h"
0021
0022 class POPPLER_PRIVATE_EXPORT EmbFile
0023 {
0024 public:
0025 explicit EmbFile(Object &&efStream);
0026 ~EmbFile();
0027
0028 EmbFile(const EmbFile &) = delete;
0029 EmbFile &operator=(const EmbFile &) = delete;
0030
0031 int size() const { return m_size; }
0032 const GooString *modDate() const { return m_modDate; }
0033 const GooString *createDate() const { return m_createDate; }
0034 const GooString *checksum() const { return m_checksum; }
0035 const GooString *mimeType() const { return m_mimetype; }
0036 Object *streamObject() { return &m_objStr; }
0037 Stream *stream() { return isOk() ? m_objStr.getStream() : nullptr; }
0038 bool isOk() const { return m_objStr.isStream(); }
0039 bool save(const char *path);
0040
0041 private:
0042 bool save2(FILE *f);
0043
0044 int m_size;
0045 GooString *m_createDate;
0046 GooString *m_modDate;
0047 GooString *m_checksum;
0048 GooString *m_mimetype;
0049 Object m_objStr;
0050 };
0051
0052 class POPPLER_PRIVATE_EXPORT FileSpec
0053 {
0054 public:
0055 explicit FileSpec(const Object *fileSpec);
0056 ~FileSpec();
0057
0058 FileSpec(const FileSpec &) = delete;
0059 FileSpec &operator=(const FileSpec &) = delete;
0060
0061 bool isOk() const { return ok; }
0062
0063 const GooString *getFileName() const { return fileName; }
0064 GooString *getFileNameForPlatform();
0065 const GooString *getDescription() const { return desc; }
0066 EmbFile *getEmbeddedFile();
0067
0068 static Object newFileSpecObject(XRef *xref, GooFile *file, const std::string &fileName);
0069
0070 private:
0071 bool ok;
0072
0073 Object fileSpec;
0074
0075 GooString *fileName;
0076 GooString *platformFileName;
0077 Object fileStream;
0078 EmbFile *embFile;
0079 GooString *desc;
0080 };
0081
0082 Object getFileSpecName(const Object *fileSpec);
0083 Object POPPLER_PRIVATE_EXPORT getFileSpecNameForPlatform(const Object *fileSpec);
0084
0085 #endif