Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #include "export.hxx"
21 : #include "xmlparse.hxx"
22 : #include <rtl/ustring.hxx>
23 : #include <rtl/ustrbuf.hxx>
24 : #include <rtl/strbuf.hxx>
25 : #include <memory> /* auto_ptr */
26 :
27 : /// This Class is responsible for extracting/merging OpenOffice XML Helpfiles
28 : class HelpParser
29 : {
30 : private:
31 : rtl::OString sHelpFile;
32 :
33 : #if OSL_DEBUG_LEVEL > 2
34 : /// Debugmethod, prints the content of the map to stdout
35 : static void Dump(LangHashMap* rElem_in , const rtl::OString & sKey_in);
36 :
37 : /// Debugmethod, prints the content of the map to stdout
38 : static void Dump(XMLHashMap* rElem_in);
39 : #endif
40 :
41 : public:
42 : HelpParser( const rtl::OString &rHelpFile );
43 0 : ~HelpParser(){};
44 :
45 : /// Method creates/append a SDF file with the content of a parsed XML file
46 : /// @PRECOND rHelpFile is valid
47 : static bool CreateSDF( const rtl::OString &rSDFFile_in, const rtl::OString &rPrj_in, const rtl::OString &rRoot_in,
48 : const rtl::OString &sHelpFile, XMLFile *pXmlFile, const rtl::OString &rGsi1 );
49 :
50 : /// Method merges the String from the SDFfile into XMLfile. Both Strings must
51 : /// point to existing files.
52 : bool Merge( const rtl::OString &rSDFFile_in, const rtl::OString &rDestinationFile_in ,
53 : const rtl::OString& sLanguage , MergeDataFile& aMergeDataFile );
54 :
55 : private:
56 : bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const rtl::OString& sLanguage , rtl::OString const & sPath );
57 :
58 : void ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
59 : };
60 :
61 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|