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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "sal/config.h"
32 #include "helpmerge.hxx"
39 << "Syntax: Helpex [-p Prj] [-r Root] -[m]i FileIn -o FileOut"
40 << " [-m DataBase] [-l l1,l2,...]\n"
42 << " Root: Path to project root (../.. etc.)\n"
43 << " FileIn + i: Source file (*.xhp)\n"
44 << " FileIn + -mi: File including pathes of source files"
45 << " (only for merge)"
46 << " FileOut: Destination file (*.*) or files (in case of -mi)\n"
47 << " DataBase: Mergedata (*.po)\n"
48 << " -l: Restrict the handled languages; l1, l2, ... are elements of"
49 << " (de, en-US, ...)\n";
52 SAL_IMPLEMENT_MAIN_WITH_ARGS(argc
, argv
) {
54 bool bMultiMerge
= false;
55 for (int nIndex
= 1; nIndex
!= argc
; ++nIndex
)
57 if (std::strcmp(argv
[nIndex
], "-mi") == 0)
59 argv
[nIndex
][1] = 'i';
60 argv
[nIndex
][2] = '\0';
67 if ( !Export::handleArguments( argc
, argv
, aArgs
) )
72 bool hasNoError
= true;
74 if ( aArgs
.m_bMergeMode
)
78 std::ifstream
aInput( aArgs
.m_sInputFile
.getStr() );
79 if( !aInput
.is_open() )
81 std::cerr
<< "Helpex error: cannot open input file\n";
84 MergeDataFile
aMergeDataFile(
85 aArgs
.m_sMergeSrc
, OString(), false, false );
88 while( !aInput
.eof() )
90 const OString
sXhpFile( sTemp
.data(), sTemp
.length() );
91 HelpParser
aParser( sXhpFile
);
92 const OString
sOutput(
94 sXhpFile
.copy( sXhpFile
.lastIndexOf("/") ));
95 if( !aParser
.Merge( aArgs
.m_sMergeSrc
, sOutput
,
96 Export::sLanguages
, aMergeDataFile
))
106 HelpParser
aParser( aArgs
.m_sInputFile
);
107 MergeDataFile
aMergeDataFile(
108 aArgs
.m_sMergeSrc
, aArgs
.m_sInputFile
, false, false );
111 aArgs
.m_sMergeSrc
, aArgs
.m_sOutputFile
,
112 Export::sLanguages
, aMergeDataFile
);
117 HelpParser
aParser( aArgs
.m_sInputFile
);
120 aArgs
.m_sOutputFile
, aArgs
.m_sPrj
, aArgs
.m_sPrjRoot
,
121 aArgs
.m_sInputFile
, new XMLFile( OUString('0') ), "help" );
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */