beta-0.89.2
[luatex.git] / source / libs / poppler / poppler-src / poppler / FileSpec.h
blob9f2f6fcd13188f8d2dbad746d8ef2ab929714931
1 //========================================================================
2 //
3 // FileSpec.h
4 //
5 // All changes made under the Poppler project to this file are licensed
6 // under GPL version 2 or later
7 //
8 // Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
9 //
10 // To see a description of the changes please see the Changelog file that
11 // came with your tarball or type make ChangeLog if you are building from git
13 //========================================================================
15 #ifndef FILE_SPEC_H
16 #define FILE_SPEC_H
18 #ifdef USE_GCC_PRAGMAS
19 #pragma interface
20 #endif
22 #include "Object.h"
24 class EmbFile {
25 public:
26 EmbFile(Object *efStream);
27 ~EmbFile();
29 int size() { return m_size; }
30 GooString *modDate() { return m_modDate; }
31 GooString *createDate() { return m_createDate; }
32 GooString *checksum() { return m_checksum; }
33 GooString *mimeType() { return m_mimetype; }
34 Stream *stream() { return isOk() ? m_objStr.getStream() : NULL; }
35 GBool isOk() { return m_objStr.isStream(); }
36 GBool save(const char *path);
38 private:
39 GBool save2(FILE *f);
41 int m_size;
42 GooString *m_createDate;
43 GooString *m_modDate;
44 GooString *m_checksum;
45 GooString *m_mimetype;
46 Object m_objStr;
49 class FileSpec {
50 public:
51 FileSpec(Object *fileSpec);
52 ~FileSpec();
54 GBool isOk() { return ok; }
56 GooString *getFileName() const { return fileName; }
57 GooString *getFileNameForPlatform();
58 GooString *getDescription() const { return desc; }
59 EmbFile *getEmbeddedFile();
61 private:
62 GBool ok;
64 Object fileSpec;
66 GooString *fileName; // F, UF, DOS, Mac, Unix
67 GooString *platformFileName;
68 Object fileStream; // Ref to F entry in UF
69 EmbFile *embFile;
70 GooString *desc; // Desc
73 GBool getFileSpecName (Object *fileSpec, Object *fileName);
74 GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName);
76 #endif /* FILE_SPEC_H */