|
a/src/internfile/Filter.h |
|
b/src/internfile/Filter.h |
|
... |
|
... |
103 |
/** (Re)initializes the filter with the given data.
|
103 |
/** (Re)initializes the filter with the given data.
|
104 |
* Caller should ensure the given pointer is valid until the
|
104 |
* Caller should ensure the given pointer is valid until the
|
105 |
* Filter object is destroyed, as some filters may not need to
|
105 |
* Filter object is destroyed, as some filters may not need to
|
106 |
* do a deep copy of the data.
|
106 |
* do a deep copy of the data.
|
107 |
* Call next_document() to position the filter onto the first document.
|
107 |
* Call next_document() to position the filter onto the first document.
|
108 |
* Returns false if this input is not supported or an error occured.
|
108 |
* Returns false if this input is not supported or an error occurred.
|
109 |
*/
|
109 |
*/
|
110 |
virtual bool set_document_data(const std::string& mtype,
|
110 |
virtual bool set_document_data(const std::string& mtype,
|
111 |
const char *data_ptr,
|
111 |
const char *data_ptr,
|
112 |
size_t data_length) = 0;
|
112 |
size_t data_length) = 0;
|
113 |
|
113 |
|
114 |
/** (Re)initializes the filter with the given data.
|
114 |
/** (Re)initializes the filter with the given data.
|
115 |
* Call next_document() to position the filter onto the first document.
|
115 |
* Call next_document() to position the filter onto the first document.
|
116 |
* Returns false if this input is not supported or an error occured.
|
116 |
* Returns false if this input is not supported or an error occurred.
|
117 |
*/
|
117 |
*/
|
118 |
virtual bool set_document_string(const std::string& mtype,
|
118 |
virtual bool set_document_string(const std::string& mtype,
|
119 |
const std::string &data_str) = 0;
|
119 |
const std::string &data_str) = 0;
|
120 |
|
120 |
|
121 |
/** (Re)initializes the filter with the given file.
|
121 |
/** (Re)initializes the filter with the given file.
|
122 |
* Call next_document() to position the filter onto the first document.
|
122 |
* Call next_document() to position the filter onto the first document.
|
123 |
* Returns false if this input is not supported or an error occured.
|
123 |
* Returns false if this input is not supported or an error occurred.
|
124 |
*/
|
124 |
*/
|
125 |
virtual bool set_document_file(const std::string& mtype,
|
125 |
virtual bool set_document_file(const std::string& mtype,
|
126 |
const std::string &file_path) = 0;
|
126 |
const std::string &file_path) = 0;
|
127 |
|
127 |
|
128 |
/** (Re)initializes the filter with the given URI.
|
128 |
/** (Re)initializes the filter with the given URI.
|
129 |
* Call next_document() to position the filter onto the first document.
|
129 |
* Call next_document() to position the filter onto the first document.
|
130 |
* Returns false if this input is not supported or an error occured.
|
130 |
* Returns false if this input is not supported or an error occurred.
|
131 |
*/
|
131 |
*/
|
132 |
virtual bool set_document_uri(const std::string& mtype,
|
132 |
virtual bool set_document_uri(const std::string& mtype,
|
133 |
const std::string &uri) = 0;
|
133 |
const std::string &uri) = 0;
|
134 |
|
134 |
|
135 |
/** Set the document size meta_data element. This is the size
|
135 |
/** Set the document size meta_data element. This is the size
|
|
... |
|
... |
145 |
|
145 |
|
146 |
// Going from one nested document to the next.
|
146 |
// Going from one nested document to the next.
|
147 |
|
147 |
|
148 |
/** Returns true if there are nested documents left to extract.
|
148 |
/** Returns true if there are nested documents left to extract.
|
149 |
* Returns false if the end of the parent document was reached
|
149 |
* Returns false if the end of the parent document was reached
|
150 |
* or an error occured.
|
150 |
* or an error occurred.
|
151 |
*/
|
151 |
*/
|
152 |
virtual bool has_documents(void) const = 0;
|
152 |
virtual bool has_documents(void) const = 0;
|
153 |
|
153 |
|
154 |
/** Moves to the next nested document.
|
154 |
/** Moves to the next nested document.
|
155 |
* Returns false if there are none left.
|
155 |
* Returns false if there are none left.
|
|
... |
|
... |
162 |
virtual bool skip_to_document(const std::string &ipath) = 0;
|
162 |
virtual bool skip_to_document(const std::string &ipath) = 0;
|
163 |
|
163 |
|
164 |
|
164 |
|
165 |
// Accessing documents' contents.
|
165 |
// Accessing documents' contents.
|
166 |
|
166 |
|
167 |
/// Returns the message for the most recent error that has occured.
|
167 |
/// Returns the message for the most recent error that has occurred.
|
168 |
virtual std::string get_error(void) const = 0;
|
168 |
virtual std::string get_error(void) const = 0;
|
169 |
|
169 |
|
170 |
/** Returns a dictionary of metadata extracted from the current document.
|
170 |
/** Returns a dictionary of metadata extracted from the current document.
|
171 |
* Metadata fields may include one or more of the following :
|
171 |
* Metadata fields may include one or more of the following :
|
172 |
* content, title, ipath, mimetype, language, charset, author, creator,
|
172 |
* content, title, ipath, mimetype, language, charset, author, creator,
|