1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_HELPCOMPILER_HELPINDEXER_HXX
11 #define INCLUDED_HELPCOMPILER_HELPINDEXER_HXX
13 #include <helpcompiler/dllapi.h>
15 #include <rtl/ustring.hxx>
17 #include <string_view>
19 // I assume that TCHAR is defined as wchar_t throughout
33 class L10N_DLLPUBLIC HelpIndexer
{
37 OUString d_captionDir
;
38 OUString d_contentDir
;
41 std::set
<OUString
> d_files
;
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 lang
, OUString module
,
52 std::u16string_view srcDir
, std::u16string_view outDir
);
56 * @return true if index successfully generated.
58 bool indexDocuments();
61 * Get the error string (empty if no error occurred).
63 OUString
const & getErrorMessage() const { return d_error
;}
68 * Scan the caption & contents directories for help files.
73 * Scan for files in the given directory.
75 bool scanForFiles(OUString
const &path
);
78 * Fill the Document with information on the given help file.
80 void helpDocument(OUString
const & fileName
, lucene::document::Document
*doc
) const;
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
);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */