Foxit PDF SDK
fs_filespec.h
浏览该文件的文档.
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 
63  explicit FileSpec(const PDFDoc& document, objects::PDFObject* pdf_object);
64 
70  FileSpec(const FileSpec& other);
78  FileSpec& operator = (const FileSpec& other);
79 
87  bool operator == (const FileSpec& other) const;
95  bool operator != (const FileSpec& other) const;
96 
98  ~FileSpec();
99 
107  bool IsEmpty() const;
108 
114  WString GetFileName() const;
115 
125  void SetFileName(const wchar_t* file_name);
126 
134 
146  void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship);
147 
156  int64 GetFileSize() const;
157 
167 
175 
186  bool Embed(const wchar_t* file_path);
198  bool Embed(foxit::pdf::objects::PDFObject* pdf_object);
199 
212 
219  bool IsEmbedded() const;
220 
226  String GetDescription() const;
227 
235  void SetDescription(const String& description);
236 
256  void SetCreationDateTime(const DateTime& date_time);
276  void SetModifiedDateTime(const DateTime& date_time);
287  String GetChecksum() const;
299  void SetChecksum(const String& checksum);
300 
309  String GetSubtype() const;
310 
321  void SetSubtype(const String& subtype = "application/octet-stream");
322 
329 
337  bool ExportToFile(const wchar_t* path) const;
338 
347 
348  // 强烈建议用户不要使用此方法;否则可能会出现未知情况。
349  explicit FileSpec(FS_HANDLE handle = NULL);
350 };
351 } // namespace pdf
352 } // namespace foxit
353 #endif // FS_FILESPEC_H_
354 
DateTime GetModifiedDateTime() const
获取关于嵌入文件最后修改时间的修改日期和时间。
common::file::ReaderCallback * GetFileData() const
获取嵌入文件的文件数据。
void SetAssociteFileRelationship(AssociatedFiles::Relationship associfile_relationship)
(仅在PDF 2.0中支持)当当前文件规范用作关联文件时,设置关联文件关系。
AssociatedFiles::Relationship GetAssociteFileRelationship() const
(仅在PDF 2.0中支持)当当前文件规范用作关联文件时,获取关联文件关系。
Relationship
PDF文档与关联文件之间关系的枚举。
Definition: fs_pdfassociatefiles.h:58
Definition: fs_basictypes.h:482
文件操作相关定义和函数的头文件。
文件读取接口。
Definition: fx_stream.h:587
FileSpec(const PDFDoc &document)
构造函数。
宽字符串类
Definition: fx_string.h:1457
String GetSubtype() const
(仅在PDF 2.0中支持)当当前文件规范用作关联文件时, 获取嵌入文件的"Subtype"键的MIME类型值。
void SetSubtype(const String &subtype="application/octet-stream")
(仅在PDF 2.0中支持)当当前文件规范用作关联文件时, 为嵌入文件的"Subtype"键设置MIME类型值。(不影响本地文件)
Definition: fs_pdfdoc.h:771
bool IsEmpty() const
检查当前对象是否为空。
objects::PDFDictionary * GetDict() const
获取当前文件规范的PDF字典。
int64 GetFileSize() const
获取嵌入文件的大小(未压缩文件大小)。
String GetChecksum() const
获取嵌入文件的校验和。
DateTime GetCreationDateTime() const
获取关于嵌入文件创建时间的创建日期和时间。
WString GetFileName() const
获取文件名。
bool IsEmbedded() const
检查当前文件规范对象是否表示嵌入文件。
文件流接口,用于读取和写入。
Definition: fx_stream.h:692
bool Embed(const wchar_t *file_path)
嵌入由文件路径指定的文件的全部内容。
bool operator==(const FileSpec &other) const
相等操作符。
FX_INT64 int64
有符号 64 位整数。
Definition: fs_basictypes.h:190
bool ExportToFile(const wchar_t *path) const
将当前文件规范中表示的文件数据直接导出到文件中。
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:214
通用定义和类的头文件。
void SetModifiedDateTime(const DateTime &date_time)
为嵌入文件设置最后修改日期和时间。(不影响本地文件)
void SetCreationDateTime(const DateTime &date_time)
为嵌入文件设置创建日期和时间。(不影响本地文件)
void SetDescription(const String &description)
设置与当前文件规范关联的描述性文本。
bool operator !=(const FileSpec &other) const
不相等操作符。
PDF对象相关定义和类的头文件。
Definition: fs_basictypes.h:449
Definition: fs_filespec.h:38
String GetDescription() const
获取与当前文件规范关联的描述性文本。
Definition: fs_pdfobject.h:848
Foxit命名空间。
Definition: fs_taggedpdf.h:27
Definition: fs_pdfobject.h:55
字节字符串类
Definition: fx_string.h:317
~FileSpec()
析构函数。
#define NULL
空指针值。
Definition: fx_system.h:792
bool ExportToFileStream(foxit::common::file::StreamCallback *stream) const
通过流回调对象导出当前文件规范中表示的文件数据。
关联文件相关定义和类的头文件。
void SetChecksum(const String &checksum)
为嵌入文件设置校验和。(不影响本地文件)
void SetFileName(const wchar_t *file_name)
设置文件名。
int64 GetCompressedEmbeddedFileSize() const
获取嵌入文件的压缩文件大小。
FileSpec & operator=(const FileSpec &other)
赋值操作符。