Generic Filter. More...
#include <gfilter.h>
Public Member Functions | |
GFilter (GSession *session, GPlugInFactory *fac) | |
void | AddMIME (const R::RString &mime) |
void | AddScheme (const R::RString &scheme) |
virtual R::RURI | GetValidURI (const R::RURI &uri, bool &mustdelete) |
virtual void | Analyze (GDocAnalyze *analyzer, const GDoc *doc, const R::RURI &file)=0 |
virtual R::RString | GetTextFragment (GDoc *doc, size_t begin, size_t end) |
virtual | ~GFilter (void) |
Public Member Functions inherited from GPlugIn | |
GPlugIn (GSession *session, GPlugInFactory *fac) | |
virtual void | ApplyConfig (void) |
void | InsertParam (R::RParam *param) |
template<class T > | |
T * | FindParam (const R::RString &name) |
R::RCursor< R::RParam > | GetParams (const R::RString &cat=R::RString::Null) |
void | GetCategories (R::RContainer< R::RString, true, false > &cats) |
virtual void | Init (void) |
virtual void | CreateConfig (void) |
virtual void | Reset (void) |
GPlugInFactory * | GetFactory (void) const |
int | Compare (const GPlugIn &plugin) const |
int | Compare (const R::RString &plugin) const |
R::RString | GetName (void) const |
R::RString | GetDesc (void) const |
GSession * | GetSession (void) const |
virtual void | Done (void) |
virtual | ~GPlugIn (void) |
Additional Inherited Members | |
Protected Attributes inherited from GPlugIn | |
GPlugInFactory * | Factory |
GSession * | Session |
size_t | Id |
Detailed Description
Generic Filter.
The GFilter class provides a generic filter that extracts text from a document of a given type. In practice, the filter calls the methods Extract* from the GDocAnalyze class.
Each filter is associated with a given set of MIME types. This association is used to determine which filter should extracts the text from a document.
See the documentation related to GPlugIn for more general information.
Constructor & Destructor Documentation
GFilter | ( | GSession * | session, |
GPlugInFactory * | fac | ||
) |
Construct the filter.
- Parameters
-
session Session. fac Factory.
|
virtual |
Destruct the filter.
Member Function Documentation
void AddMIME | ( | const R::RString & | mime | ) |
Add a specific MIME-Type for the filter.
- Parameters
-
mime Name of the MIME-Type.
void AddScheme | ( | const R::RString & | scheme | ) |
Add a specific scheme for the filter.
- Parameters
-
scheme Name of the scheme.
Get a valid URI (something that a normal RFile can handle) and specify if the corresponding document must be deleted (because it is temporary file) or not once the caller does not need it anymore.
- Parameters
-
uri Original URI. mustdelete Must the document be deleted by the caller (modified by the function.
- Returns
- an URI.
|
pure virtual |
Analyze a document with a given URI. This method must be re-implemented by all filters.
- Parameters
-
analyzer Analyzer. doc Document to analyze. file File to analyze (eventually a local copy of a remote document).
|
virtual |
Extract a text fragment. This method can be re-implemented by filters.
- Parameters
-
doc Document to extract from. begin Beginning position. end Ending position.
- Returns
- a string containing the text fragment.