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 #ifndef XRMMERGE_INCLUDED
21 #define XRMMERGE_INCLUDED
23 #include "sal/config.h"
28 /// Parser for *.xrm and description.xml files
38 OString sCurrentOpenTag
;
39 OString sCurrentCloseTag
;
42 OString
GetAttribute( const OString
&rToken
, const OString
&rAttribute
);
43 void Error( const OString
&rError
);
45 virtual void Output( const OString
& rOutput
)=0;
46 virtual void WorkOnDesc(
47 const OString
&rOpenTag
,
50 virtual void WorkOnText(
51 const OString
&rOpenTag
,
54 virtual void EndOfText(
55 const OString
&rOpenTag
,
56 const OString
&rCloseTag
59 OString
GetGID() { return sGID
; }
60 OString
GetLID() { return sLID
; }
64 virtual ~XRMResParser();
66 int Execute( int nToken
, char * pToken
);
68 void SetError( sal_Bool bErr
= sal_True
) { bError
= bErr
; }
69 sal_Bool
GetError() { return bError
; }
73 /// Export strings from *.xrm and description.xml files
74 class XRMResExport
: public XRMResParser
79 PoOfstream pOutputStream
;
82 const OString
&rOpenTag
,
86 const OString
&rOpenTag
,
90 const OString
&rOpenTag
,
91 const OString
&rCloseTag
93 void Output( const OString
& rOutput
);
97 const OString
&rOutputFile
,
98 const OString
&rFilePath
100 virtual ~XRMResExport();
104 /// Merge strings to *.xrm and description.xml files
105 class XRMResMerge
: public XRMResParser
108 MergeDataFile
*pMergeDataFile
;
111 std::ofstream pOutputStream
;
112 std::vector
<OString
> aLanguages
;
116 const OString
&rOpenTag
,
120 const OString
&rOpenTag
,
124 const OString
&rOpenTag
,
125 const OString
&rCloseTag
127 void Output( const OString
& rOutput
);
130 const OString
&rMergeSource
,
131 const OString
&rOutputFile
,
132 const OString
&rFilename
134 virtual ~XRMResMerge();
137 #endif // XRMMERGE_INCLUDED
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */