37 << (
" Syntax: Helpex -[m]i FileIn -o FileOut [-m DataBase] [-l Lang]\n"
38 " FileIn + i: Source file (*.xhp)\n"
39 " FileIn + -mi: File including paths of source files"
41 " FileOut: Destination file (*.*) or files (in case of -mi)\n"
42 " DataBase: Mergedata (*.po)\n"
43 " Lang: Restrict the handled languages; one element of\n"
44 " (de, en-US, ...) or all\n");
49 bool hasNoError =
true;
52 bool bMultiMerge =
false;
55 if (std::strcmp(argv[
nIndex],
"-mi") == 0)
76 if( !aInput.is_open() )
78 std::cerr <<
"Helpex error: cannot open input file\n";
81 std::unique_ptr<MergeDataFile> pMergeDataFile;
88 while( !aInput.eof() )
91 const OString sXhpFile( sTemp.data(),
static_cast<sal_Int32
>(sTemp.length()) );
93 const OString sOutput(
95 sXhpFile.subView( sXhpFile.lastIndexOf(
'/') ));
96 if( !aParser.
Merge( sOutput,
108 std::unique_ptr<MergeDataFile> pMergeDataFile;
122 XMLFile xmlfile( OString(
'0') );
129 catch (std::exception& e)
131 std::cerr <<
"Helpex exception: " << e.what() << std::endl;
This Class is responsible for extracting/merging OpenOffice XML Helpfiles.
bool Merge(const OString &rDestinationFile_in, const OString &sLanguage, MergeDataFile *pMergeDataFile)
Method merges the String into XMLfile, which must point to an existing file.
static bool CreatePO(const OString &rPOFile_in, const OString &sHelpFile, XMLFile *pXmlFile, std::string_view rGsi1)
Method append a PO file with the content of a parsed XML file @PRECOND rHelpFile is valid.
Purpose: holds information of data to merge, read from PO file.
Holds information of a XML file, is root node of tree.
SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bool handleArguments(int argc, char *argv[], HandledArgs &o_aHandledArgs)
Handle command line parameters.
Result type of handleArguments()