fs_filespec.h
1 #ifndef FS_FILESPEC_H_
2 #define FS_FILESPEC_H_
3 
4 #include "common/fs_common.h"
5 #include "common/file/fs_file.h"
6 #include "pdf/fs_pdfdoc.h"
14 namespace foxit {
18 namespace pdf {
24 class FileSpec FS_FINAL : public Base {
25  public:
33  explicit FileSpec(const PDFDoc& document);
34 
48  explicit FileSpec(const PDFDoc& document, objects::PDFObject* pdf_object);
49 
55  FileSpec(const FileSpec& other);
63  FileSpec& operator = (const FileSpec& other);
64 
72  bool operator == (const FileSpec& other) const;
80  bool operator != (const FileSpec& other) const;
81 
83  ~FileSpec();
84 
92  bool IsEmpty() const;
93 
99  WString GetFileName() const;
100 
111  void SetFileName(const wchar_t* file_name);
112 
121 
133  void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship);
134 
144  int64 GetFileSize() const;
145 
152 
163  bool Embed(const wchar_t* file_path);
177  bool Embed(foxit::pdf::objects::PDFObject* pdf_object);
178 
185  bool IsEmbedded() const;
191  String GetDescription() const;
199  void SetDescription(const String& description);
219  void SetCreationDateTime(const DateTime& date_time);
239  void SetModifiedDateTime(const DateTime& date_time);
252  String GetChecksum() const;
265  void SetChecksum(const String& checksum);
266 
276  String GetSubtype() const;
277 
289  void SetSubtype(const String& subtype = "application/octet-stream");
290 
297 
305  bool ExportToFile(const wchar_t* path) const;
306 
307  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
308  explicit FileSpec(FS_HANDLE handle = NULL);
309 };
310 } // namespace pdf
311 } // namespace foxit
312 #endif // namespace foxit
313 
DateTime GetModifiedDateTime() const
Get modified date and time about when the embedded file was last modified.
common::file::ReaderCallback * GetFileData() const
Get the file data of embedded file.
void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship)
(Only supported in PDF 2.0) Set the associated file relationship when current file specification is u...
AssociatedFiles::Relationship GetAssociteFileRelationship() const
(Only supported in PDF 2.0) Get the associated file relationship when current file specification is u...
Header file for PDF document related definitions and classes.
Relationship
Enumeration for the relationship between PDF document and the associated file.
Definition: fs_pdfassociatefiles.h:60
Definition: fs_basictypes.h:366
Header file for file operation related definitions and functions.
File reading interface.
Definition: fx_stream.h:555
FileSpec(const PDFDoc &document)
Constructor.
WIDE STRING CLASS.
Definition: fx_string.h:1463
String GetSubtype() const
(Only support in PDF 2.0) Get the MIME type value for "Subtype" key for embedded file when current fi...
void SetSubtype(const String &subtype="application/octet-stream")
(Only support in PDF 2.0) Set the MIME type value for "Subtype" key for embedded file (Not affect loc...
Definition: fs_pdfdoc.h:338
bool IsEmpty() const
Check whether current object is empty or not.
objects::PDFDictionary * GetDict() const
Get the PDF dictionary of current file specification.
int64 GetFileSize() const
Get the size of embedded file.
String GetChecksum() const
Get the checksum for embedded file.
bool operator!=(const FileSpec &other) const
Not equal operator.
DateTime GetCreationDateTime() const
Get creation date and time about when the embedded file was created.
WString GetFileName() const
Get the file name.
bool IsEmbedded() const
Check whether current file specification object represents an embedded file or not.
bool Embed(const wchar_t *file_path)
Embed the whole content of a file which is specified by file path.
bool operator==(const FileSpec &other) const
Equal operator.
FX_INT64 int64
Signed 64-bit integer.
Definition: fs_basictypes.h:189
bool ExportToFile(const wchar_t *path) const
Export the file data that represented in current file specification directly into a file...
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
void SetModifiedDateTime(const DateTime &date_time)
Set last modified date and time for the embedded file. (Not affect local file)
void SetCreationDateTime(const DateTime &date_time)
Set the creation date and time for the embedded file. (Not affect local file)
void SetDescription(const String &description)
Set the descriptive text associated with current file specification.
Header file for PDF object related definitions and classes.
Definition: fs_basictypes.h:333
Definition: fs_filespec.h:24
String GetDescription() const
Get the descriptive text associated with current file specification.
Definition: fs_pdfobject.h:762
Foxit namespace.
Definition: fs_connectedpdf.h:26
Definition: fs_pdfobject.h:55
BYTE STRING CLASS.
Definition: fx_string.h:317
~FileSpec()
Destructor.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
Header file for associated file related definitions and classes.
void SetChecksum(const String &checksum)
Set the checksum for embedded file. (Not affect local file)
void SetFileName(const wchar_t *file_name)
Set the file name.
FileSpec & operator=(const FileSpec &other)
Assign operator.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.