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 #include <helpcompiler/HelpIndexer.hxx>
11 #include <osl/file.hxx>
12 #include <osl/process.h>
13 #include <osl/thread.h>
17 #include "LuceneHelper.hxx"
19 int main(int argc
, char **argv
) {
20 const std::string
pLang("-lang");
21 const std::string
pModule("-mod");
22 const std::string
pDir("-dir");
29 for (int i
= 1; i
< argc
; ++i
) {
30 if (pLang
.compare(argv
[i
]) == 0) {
36 } else if (pModule
.compare(argv
[i
]) == 0) {
42 } else if (pDir
.compare(argv
[i
]) == 0) {
54 std::cerr
<< "Error parsing command-line arguments" << std::endl
;
57 if (error
|| lang
.empty() || module
.empty() || dir
.empty()) {
58 std::cerr
<< "Usage: HelpIndexer -lang ISOLangCode -mod HelpModule -dir Dir" << std::endl
;
64 osl::File::getFileURLFromSystemPath(
65 OUString(dir
.c_str(), dir
.size(), osl_getThreadTextEncoding()),
69 osl_getProcessWorkingDir(&cwd
.pData
);
71 osl::File::getAbsoluteFileURL(cwd
, sDir
, sDir
);
74 OUString(lang
.c_str(), lang
.size(), osl_getThreadTextEncoding()),
75 OUString(module
.c_str(), module
.size(), osl_getThreadTextEncoding()),
78 if (!indexer
.indexDocuments()) {
79 std::cerr
<< OUStringToOString(indexer
.getErrorMessage(), osl_getThreadTextEncoding()).getStr() << std::endl
;
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */