fs_fulltextsearch.h
Go to the documentation of this file.
1 
15 #ifndef FS_FULLTEXTSEARCH_H_
16 #define FS_FULLTEXTSEARCH_H_
17 
18 #include "common/fs_common.h"
19 
25 namespace foxit {
29 namespace fts {
38  public:
44  virtual void Release() = 0;
57  virtual int RetrieveSearchResult(const wchar_t* file_path, int page_index, const WString& match_result,
58  int match_start_text_index, int match_end_text_index) = 0;
59 
60  protected:
61  ~SearchCallback() {}
62 };
63 
68 class DocumentsSource FS_FINAL : public Base{
69  public:
75  explicit DocumentsSource(const char* directory);
83  DocumentsSource(const DocumentsSource& other);
92 
100  bool operator == (const DocumentsSource& other) const;
108  bool operator != (const DocumentsSource& other) const;
109 
117  bool IsEmpty() const;
118 
119  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
120  explicit DocumentsSource(FS_HANDLE handle = NULL);
121 
122 };
123 
127 class FullTextSearch FS_FINAL : public Base{
128  public:
134  typedef enum _RankMode {
147  } RankMode;
148 
150  FullTextSearch();
152  ~FullTextSearch();
158  FullTextSearch(const FullTextSearch& other);
167 
175  bool operator == (const FullTextSearch& other) const;
183  bool operator != (const FullTextSearch& other) const;
191  bool IsEmpty() const;
192 
206  void SetDataBasePath(const char* path_of_data_base);
207 
228  bool reupdate = false);
229 
239  bool UpdateIndexWithFilePath(const char* file_path);
240 
257  bool SearchOf(const char* match_string, RankMode rank_mode, SearchCallback* callback);
258 
259  // User is strongly recommended NOT to use this method; otherwise unknown situation may occur.
260  explicit FullTextSearch(FS_HANDLE handle);
261 };
262 } // namespace fts
263 }; // namespace foxit
264 
265 #endif // FS_FULLTEXTSEARCH_H_
266 
virtual void Release()=0
A callback function used to release current SearchCallback object itself.
DocumentsSource(const char *directory)
Constructor, with a directory.
bool operator!=(const DocumentsSource &other) const
Not equal operator.
Definition: fs_fulltextsearch.h:68
No ranking mode is used for searching results.
Definition: fs_fulltextsearch.h:136
Definition: fs_fulltextsearch.h:37
bool IsEmpty() const
Check whether current object is empty or not.
bool UpdateIndexWithFilePath(const char *file_path)
Update the index result of a specified PDF file.
WIDE STRING CLASS.
Definition: fx_string.h:1463
Rank the searching results according to how the result matches the expected searching patten,...
Definition: fs_fulltextsearch.h:146
FullTextSearch & operator=(const FullTextSearch &other)
Assign operator.
Definition: fs_fulltextsearch.h:127
void SetDataBasePath(const char *path_of_data_base)
Set a file path as sqlite data base which is used for storing the indexed data.
DocumentsSource & operator=(const DocumentsSource &other)
Assign operator.
RankMode
Enumeration for ranking mode used for searching results.
Definition: fs_fulltextsearch.h:134
virtual int RetrieveSearchResult(const wchar_t *file_path, int page_index, const WString &match_result, int match_start_text_index, int match_end_text_index)=0
A callback function used to retrieve the searching result.
Definition: fx_basic.h:3566
Definition: fs_common.h:382
void * FS_HANDLE
Handle type.
Definition: fs_basictypes.h:213
Header file for common definitions and classes.
bool operator!=(const FullTextSearch &other) const
Not equal operator.
Definition: fs_basictypes.h:333
bool SearchOf(const char *match_string, RankMode rank_mode, SearchCallback *callback)
Search for specified text among the indexed PDF files.
bool operator==(const DocumentsSource &other) const
Equal operator.
common::Progressive StartUpdateIndex(const DocumentsSource &source, common::PauseCallback *pause=0, bool reupdate=false)
Start to update the index of PDF files defined in a DocumentsSource object.
Foxit namespace.
Definition: fs_connectedpdf.h:26
bool IsEmpty() const
Check whether current object is empty or not.
#define NULL
The null-pointer value.
Definition: fx_system.h:767
FullTextSearch()
Constructor.
Rank the searching results according to how the result matches the expected searching patten,...
Definition: fs_fulltextsearch.h:141
bool operator==(const FullTextSearch &other) const
Equal operator.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.