Foxit PDF SDK
fs_pdfattachments.h
浏览该文件的文档.
1 
15 #ifndef FS_PDFATTACHMENTS_H_
16 #define FS_PDFATTACHMENTS_H_
17 
18 #include "common/fs_common.h"
19 #include "pdf/fs_filespec.h"
21 
27 namespace foxit {
31 namespace pdf {
39 class Attachments FS_FINAL : public Base {
40  public:
59  explicit Attachments(const PDFDoc& doc, const objects::PDFNameTree& nametree = foxit::pdf::objects::PDFNameTree());
61  ~Attachments();
67  Attachments(const Attachments& other);
75  Attachments& operator = (const Attachments& other);
76 
84  bool operator == (const Attachments& other) const;
92  bool operator != (const Attachments& other) const;
93 
101  bool IsEmpty() const;
102 
108  int GetCount();
109 
118  WString GetKey(int index);
119 
127  FileSpec GetEmbeddedFile(const WString& key);
128 
139  bool SetEmbeddedFile(const WString& key, const FileSpec& file_spec);
140 
155  bool AddEmbeddedFile(const WString& key, const FileSpec& file_spec);
156 
170  bool AddFromFilePath(const WString& key, const wchar_t* file_path);
171 
182  bool RemoveEmbeddedFile(const WString& key);
183 
189  bool RemoveAllEmbeddedFiles();
190 
200  bool ExtractEmbeddedFileTo(const WString& key, const wchar_t* dst_file_path);
201 
208 
209  // 强烈建议用户不要使用此方法;否则可能发生未知情况。
210  explicit Attachments(FS_HANDLE handle = NULL);
211 };
212 } // namespace pdf
213 } // namespace foxit
214 
215 #endif // FS_PDFATTACHMENTS_H_
216 
bool IsEmpty() const
检查当前对象是否为空。
FileSpec GetEmbeddedFile(const WString &key)
获取指定键的附件(作为文件规范对象)。
bool SetEmbeddedFile(const WString &key, const FileSpec &file_spec)
为指定键设置嵌入附件(作为文件规范对象)。
文件规范相关定义和类的头文件。
宽字符串类
Definition: fx_string.h:1457
Definition: fs_pdfdoc.h:771
WString GetKey(int index)
通过索引获取EmbeddedFiles名称树中定义的附件键。
~Attachments()
析构函数。
bool RemoveAllEmbeddedFiles()
移除所有附件。
Attachments & operator=(const Attachments &other)
赋值操作符。
void * FS_HANDLE
句柄类型。
Definition: fs_basictypes.h:214
objects::PDFNameTree GetNameTree() const
获取EmbeddedFiles名称树。
通用定义和类的头文件。
bool operator !=(const Attachments &other) const
不等操作符。
bool AddEmbeddedFile(const WString &key, const FileSpec &file_spec)
使用新键名添加嵌入附件(作为文件规范对象)。
Definition: fs_pdfnametree.h:72
Definition: fs_basictypes.h:449
Definition: fs_filespec.h:38
PDF名称树相关定义和类的头文件。
Foxit命名空间。
Definition: fs_taggedpdf.h:27
bool ExtractEmbeddedFileTo(const WString &key, const wchar_t *dst_file_path)
提取附件并将其保存到指定文件路径。
int GetCount()
获取附件的数量。
#define NULL
空指针值。
Definition: fx_system.h:792
bool operator==(const Attachments &other) const
相等操作符。
bool AddFromFilePath(const WString &key, const wchar_t *file_path)
使用新键名从指定文件路径添加新附件。
Attachments(const PDFDoc &doc, const objects::PDFNameTree &nametree=foxit::pdf::objects::PDFNameTree())
构造函数,带参数。从PDF文档对象和EmbeddedFiles名称树(如果有的话)构造。
Definition: fs_pdfattachments.h:39
bool RemoveEmbeddedFile(const WString &key)
通过键移除附件。