diff options
author | Gert van Valkenhoef <g.h.m.van.valkenhoef@rug.nl> | 2012-02-19 13:49:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-02-23 10:31:17 +0000 |
commit | 70a7cd0923795ee5c8210b476e2897d12988ad95 (patch) | |
tree | e385d49216d229ce6428148e7ec6bdfdda2216df /l10ntools/inc | |
parent | 796818d7b5a63c30d1ec837172deb73e300bfc38 (diff) |
Add C++ HelpSearch and call from XMLHelp. Fix string conversion bug.
Diffstat (limited to 'l10ntools/inc')
-rw-r--r-- | l10ntools/inc/l10ntools/HelpSearch.hxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/l10ntools/inc/l10ntools/HelpSearch.hxx b/l10ntools/inc/l10ntools/HelpSearch.hxx new file mode 100644 index 000000000000..4885b5698222 --- /dev/null +++ b/l10ntools/inc/l10ntools/HelpSearch.hxx @@ -0,0 +1,36 @@ +#ifndef HELPSEARCH_HXX +#define HELPSEARCH_HXX + +#include <l10ntools/dllapi.h> + +#include <CLucene/StdHeader.h> +#include <CLucene.h> + +#include <rtl/ustring.hxx> +#include <vector> + +class L10N_DLLPUBLIC HelpSearch { + private: + rtl::OUString d_lang; + rtl::OUString d_indexDir; + + public: + + /** + * @param lang Help files language. + * @param indexDir The directory where the index files are stored. + */ + HelpSearch(rtl::OUString const &lang, rtl::OUString const &indexDir); + + /** + * Query the index for a certain query string. + * @param queryStr The query. + * @param captionOnly Set to true to search in the caption, not the content. + * @param rDocuments Vector to write the paths of the found documents. + * @param rScores Vector to write the scores to. + */ + bool query(rtl::OUString const &queryStr, bool captionOnly, + std::vector<rtl::OUString> &rDocuments, std::vector<float> &rScores); +}; + +#endif |