Foxit PDF SDK
fs_filespec.h
Go to the documentation of this file.
1 
15 #ifndef FS_FILESPEC_H_
16 #define FS_FILESPEC_H_
17 
18 #include "common/fs_common.h"
19 #include "common/file/fs_file.h"
27 namespace foxit {
31 namespace pdf {
32 class PDFDoc;
38 class FileSpec FS_FINAL : public Base {
39  public:
47  explicit FileSpec(const PDFDoc& document);
48 
62  explicit FileSpec(const PDFDoc& document, objects::PDFObject* pdf_object);
63 
69  FileSpec(const FileSpec& other);
77  FileSpec& operator = (const FileSpec& other);
78 
86  bool operator == (const FileSpec& other) const;
94  bool operator != (const FileSpec& other) const;
95 
97  ~FileSpec();
98 
106  bool IsEmpty() const;
107 
113  WString GetFileName() const;
114 
125  void SetFileName(const wchar_t* file_name);
126 
135 
147  void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship);
148 
158  int64 GetFileSize() const;
159 
170 
177 
188  bool Embed(const wchar_t* file_path);
202  bool Embed(foxit::pdf::objects::PDFObject* pdf_object);
203 
216 
223  bool IsEmbedded() const;
224 
230  String GetDescription() const;
231 
239  void SetDescription(const String& description);
240 
260  void SetCreationDateTime(const DateTime& date_time);
280  void SetModifiedDateTime(const DateTime& date_time);
293  String GetChecksum() const;
306  void SetChecksum(const String& checksum);
307 
317  String GetSubtype() const;
318 
330  void SetSubtype(const String& subtype = "application/octet-stream");
331 
338 
346  bool ExportToFile(const wchar_t* path) const;
347 
356 
357  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
358  explicit FileSpec(FS_HANDLE handle = NULL);
359 };
360 } // namespace pdf
361 } // namespace foxit
362 #endif // FS_FILESPEC_H_
363 
foxit::int64
FX_INT64 int64
Signed 64-bit integer.
Definition: fs_basictypes.h:190
foxit::pdf::FileSpec::GetAssociteFileRelationship
AssociatedFiles::Relationship GetAssociteFileRelationship() const
(Only supported in PDF 2.0) Get the associated file relationship when current file specification is u...
foxit::pdf::FileSpec::GetModifiedDateTime
DateTime GetModifiedDateTime() const
Get modified date and time about when the embedded file was last modified.
foxit::FS_HANDLE
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:214
foxit::pdf::FileSpec::ExportToFileStream
bool ExportToFileStream(foxit::common::file::StreamCallback *stream) const
Export the file data that represented in current file specification through a stream callback object.
foxit::pdf::FileSpec
Definition: fs_filespec.h:38
foxit::DateTime
Definition: fs_basictypes.h:460
foxit::pdf::FileSpec::SetFileName
void SetFileName(const wchar_t *file_name)
Set the file name.
foxit::pdf::FileSpec::GetDict
objects::PDFDictionary * GetDict() const
Get the PDF dictionary of current file specification.
foxit::pdf::FileSpec::GetSubtype
String GetSubtype() const
(Only support in PDF 2.0) Get the MIME type value for "Subtype" key for embedded file when current fi...
foxit::pdf::FileSpec::GetFileData
common::file::ReaderCallback * GetFileData() const
Get the file data of embedded file.
IFX_FileStream
File stream interface, reading & writing.
Definition: fx_stream.h:675
foxit::pdf::FileSpec::FileSpec
FileSpec(const PDFDoc &document)
Constructor.
foxit::pdf::FileSpec::GetCompressedEmbeddedFileSize
int64 GetCompressedEmbeddedFileSize() const
Get the compressed file size of embedded file.
fs_common.h
Header file for common definitions and classes.
IFX_FileRead
File reading interface.
Definition: fx_stream.h:570
foxit::pdf::AssociatedFiles::Relationship
Relationship
Enumeration for the relationship between PDF document and the associated file.
Definition: fs_pdfassociatefiles.h:60
fs_file.h
Header file for file operation related definitions and functions.
foxit::pdf::FileSpec::SetAssociteFileRelationship
void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship)
(Only supported in PDF 2.0) Set the associated file relationship when current file specification is u...
fs_pdfassociatefiles.h
Header file for associated file related definitions and classes.
foxit::pdf::objects::PDFObject
Definition: fs_pdfobject.h:55
foxit::pdf::FileSpec::IsEmpty
bool IsEmpty() const
Check whether current object is empty or not.
foxit::pdf::FileSpec::SetSubtype
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...
foxit::pdf::FileSpec::operator!=
bool operator!=(const FileSpec &other) const
Not equal operator.
CFX_ByteString
BYTE STRING CLASS.
Definition: fx_string.h:317
foxit::pdf::FileSpec::SetModifiedDateTime
void SetModifiedDateTime(const DateTime &date_time)
Set last modified date and time for the embedded file. (Not affect local file)
foxit::pdf::FileSpec::Embed
bool Embed(const wchar_t *file_path)
Embed the whole content of a file which is specified by file path.
foxit::pdf::FileSpec::GetCreationDateTime
DateTime GetCreationDateTime() const
Get creation date and time about when the embedded file was created.
fs_pdfobject.h
Header file for PDF object related definitions and classes.
foxit::pdf::FileSpec::operator==
bool operator==(const FileSpec &other) const
Equal operator.
foxit::pdf::FileSpec::GetFileName
WString GetFileName() const
Get the file name.
foxit
Foxit namespace.
Definition: fs_taggedpdf.h:27
foxit::pdf::FileSpec::IsEmbedded
bool IsEmbedded() const
Check whether current file specification object represents an embedded file or not.
foxit::pdf::FileSpec::GetFileSize
int64 GetFileSize() const
Get the size of embedded file (uncompressed file size).
foxit::pdf::FileSpec::SetCreationDateTime
void SetCreationDateTime(const DateTime &date_time)
Set the creation date and time for the embedded file. (Not affect local file)
foxit::pdf::objects::PDFDictionary
Definition: fs_pdfobject.h:809
foxit::pdf::FileSpec::GetChecksum
String GetChecksum() const
Get the checksum for embedded file.
foxit::pdf::FileSpec::~FileSpec
~FileSpec()
Destructor.
foxit::pdf::FileSpec::operator=
FileSpec & operator=(const FileSpec &other)
Assign operator.
NULL
#define NULL
The null-pointer value.
Definition: fx_system.h:780
foxit::pdf::PDFDoc
Definition: fs_pdfdoc.h:610
foxit::pdf::FileSpec::SetDescription
void SetDescription(const String &description)
Set the descriptive text associated with current file specification.
foxit::pdf::FileSpec::ExportToFile
bool ExportToFile(const wchar_t *path) const
Export the file data that represented in current file specification directly into a file.
CFX_WideString
WIDE STRING CLASS.
Definition: fx_string.h:1452
foxit::Base
Definition: fs_basictypes.h:427
foxit::pdf::FileSpec::SetChecksum
void SetChecksum(const String &checksum)
Set the checksum for embedded file. (Not affect local file)
foxit::pdf::FileSpec::GetDescription
String GetDescription() const
Get the descriptive text associated with current file specification.