tdf#132752: docx import: improvements for first line indent in lists
[LibreOffice.git] / include / helpcompiler / HelpIndexer.hxx
blob2f8e7f32293a4414992c9b13634dbd5f31a095bb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_HELPCOMPILER_HELPINDEXER_HXX
11 #define INCLUDED_HELPCOMPILER_HELPINDEXER_HXX
13 #include <helpcompiler/dllapi.h>
15 #include <rtl/ustring.hxx>
16 #include <set>
17 #include <string_view>
19 // I assume that TCHAR is defined as wchar_t throughout
21 namespace lucene
23 namespace document
25 class Document;
27 namespace util
29 class Reader;
33 class L10N_DLLPUBLIC HelpIndexer {
34 private:
35 OUString d_lang;
36 OUString d_module;
37 OUString d_captionDir;
38 OUString d_contentDir;
39 OUString d_indexDir;
40 OUString d_error;
41 std::set<OUString> d_files;
43 public:
45 /**
46 * @param lang Help files language.
47 * @param module The module of the helpfiles.
48 * @param srcDir The help directory to index
49 * @param outDir The directory to write the "module".idxl directory to
51 HelpIndexer(OUString const &lang, OUString const &module,
52 std::u16string_view srcDir, std::u16string_view outDir);
54 /**
55 * Run the indexer.
56 * @return true if index successfully generated.
58 bool indexDocuments();
60 /**
61 * Get the error string (empty if no error occurred).
63 OUString const & getErrorMessage() const { return d_error;}
65 private:
67 /**
68 * Scan the caption & contents directories for help files.
70 bool scanForFiles();
72 /**
73 * Scan for files in the given directory.
75 bool scanForFiles(OUString const &path);
77 /**
78 * Fill the Document with information on the given help file.
80 void helpDocument(OUString const & fileName, lucene::document::Document *doc) const;
82 /**
83 * Create a reader for the given file, and create an "empty" reader in case the file doesn't exist.
85 static lucene::util::Reader *helpFileReader(OUString const & path);
88 #endif
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */