2010-10-14 08:27:31 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-09-27 13:52:10 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2012-08-08 13:21:28 +02:00
|
|
|
|
2004-08-30 16:28:37 +00:00
|
|
|
#include "export.hxx"
|
|
|
|
#include "xmlparse.hxx"
|
|
|
|
#include <rtl/ustring.hxx>
|
|
|
|
#include <rtl/ustrbuf.hxx>
|
|
|
|
#include <rtl/strbuf.hxx>
|
|
|
|
#include <memory> /* auto_ptr */
|
|
|
|
|
|
|
|
/// This Class is responsible for extracting/merging OpenOffice XML Helpfiles
|
|
|
|
class HelpParser
|
|
|
|
{
|
|
|
|
private:
|
2012-02-02 09:11:38 +01:00
|
|
|
rtl::OString sHelpFile;
|
2004-08-30 16:28:37 +00:00
|
|
|
|
2011-07-13 21:05:35 +01:00
|
|
|
#if OSL_DEBUG_LEVEL > 2
|
|
|
|
/// Debugmethod, prints the content of the map to stdout
|
2012-02-02 09:11:38 +01:00
|
|
|
static void Dump(LangHashMap* rElem_in , const rtl::OString & sKey_in);
|
2006-03-29 12:25:19 +00:00
|
|
|
|
2011-07-13 21:05:35 +01:00
|
|
|
/// Debugmethod, prints the content of the map to stdout
|
|
|
|
static void Dump(XMLHashMap* rElem_in);
|
|
|
|
#endif
|
2006-03-29 12:25:19 +00:00
|
|
|
|
2004-08-30 16:28:37 +00:00
|
|
|
public:
|
2012-08-13 12:46:28 +02:00
|
|
|
HelpParser( const rtl::OString &rHelpFile );
|
2004-08-30 16:28:37 +00:00
|
|
|
~HelpParser(){};
|
|
|
|
|
2013-03-15 15:42:05 +01:00
|
|
|
/// Method append a PO file with the content of a parsed XML file
|
2004-08-30 16:28:37 +00:00
|
|
|
/// @PRECOND rHelpFile is valid
|
2013-03-15 15:42:05 +01:00
|
|
|
static bool CreatePO( const rtl::OString &rPOFile_in, const rtl::OString &sHelpFile,
|
|
|
|
XMLFile *pXmlFile, const rtl::OString &rGsi1 );
|
2004-08-30 16:28:37 +00:00
|
|
|
|
2013-03-15 15:42:05 +01:00
|
|
|
/// Method merges the String from the POfile into XMLfile. Both Strings must
|
2004-08-30 16:28:37 +00:00
|
|
|
/// point to existing files.
|
2013-03-15 15:42:05 +01:00
|
|
|
bool Merge( const rtl::OString &rPOFile_in, const rtl::OString &rDestinationFile_in ,
|
2011-12-07 10:49:55 +00:00
|
|
|
const rtl::OString& sLanguage , MergeDataFile& aMergeDataFile );
|
2004-08-30 16:28:37 +00:00
|
|
|
|
|
|
|
private:
|
2012-02-02 09:11:38 +01:00
|
|
|
bool MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile , const rtl::OString& sLanguage , rtl::OString const & sPath );
|
2006-06-19 16:19:10 +00:00
|
|
|
|
2012-02-02 09:11:38 +01:00
|
|
|
void ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , ResData *pResData , MergeDataFile& aMergeDataFile );
|
2004-08-30 16:28:37 +00:00
|
|
|
};
|
2010-10-14 08:27:31 +02:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|