SILVERCODERS DocToText  4.0.1512
Converts DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML and HTML documents to plain text. Extracts metadata and annotations.
 All Classes Functions Enumerations Pages
attachment.h
1 #ifndef DOCTOTEXT_ATTACHMENT_H
2 #define DOCTOTEXT_ATTACHMENT_H
3 
4 #include <map>
5 #include <string>
6 #include "variant.h"
7 
8 namespace doctotext
9 {
16  class Attachment
17  {
18  private:
19  struct Implementation;
20  Implementation* impl;
21 
22  public:
23  Attachment();
24  Attachment(const std::string& file_name);
25  Attachment(const Attachment& attachment);
26  Attachment& operator = (const Attachment& attachment);
27  ~Attachment();
28  void setFileName(const std::string& file_name);
29  void setBinaryContent(const std::string& binary_content);
30  void addField(const std::string& field_name, const Variant& field_value);
31 
33  const char* filename() const;
34 
36  const char* binaryContent() const;
37 
39  size_t binaryContentSize() const;
40 
42  bool hasField(const std::string& field_name) const;
43 
45  const Variant& getField(const std::string& field_name) const;
46 
48  const std::map<std::string, Variant>& getFields() const;
49  };
50 }
51 
52 #endif
const Variant & getField(const std::string &field_name) const
Returns value for given key (metadata)
const std::map< std::string, Variant > & getFields() const
Returns map with all keys and values.
bool hasField(const std::string &field_name) const
Checks if metadata for given key exist (for example &quot;Content-Type&quot;)
Definition: attachment.h:16
const char * binaryContent() const
Gets binary content of the attachment.
const char * filename() const
Gets attachment file name.
size_t binaryContentSize() const
Returns size of the binary content.
Definition: variant.h:13