fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / l10ntools / inc / xrmmerge.hxx
blob13fb191e3a00c88c993bfc0e3d9595ce4235e701
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 INCLUDED_L10NTOOLS_INC_XRMMERGE_HXX
21 #define INCLUDED_L10NTOOLS_INC_XRMMERGE_HXX
23 #include "sal/config.h"
25 #include <fstream>
28 /// Parser for *.xrm and description.xml files
29 class XRMResParser
31 private:
32 OString sGID;
33 OString sLID;
35 bool bError;
36 bool bText;
38 OString sCurrentOpenTag;
39 OString sCurrentCloseTag;
40 OString sCurrentText;
41 protected:
42 static OString GetAttribute( const OString &rToken, const OString &rAttribute );
43 static void Error( const OString &rError );
45 virtual void Output( const OString& rOutput )=0;
46 virtual void WorkOnDesc(
47 const OString &rOpenTag,
48 OString &rText
49 )=0;
50 virtual void WorkOnText(
51 const OString &rOpenTag,
52 OString &rText
53 )=0;
54 virtual void EndOfText(
55 const OString &rOpenTag,
56 const OString &rCloseTag
57 )=0;
59 OString GetGID() { return sGID; }
60 OString GetLID() { return sLID; }
62 public:
63 XRMResParser();
64 virtual ~XRMResParser();
66 int Execute( int nToken, char * pToken );
68 void SetError( bool bErr = true ) { bError = bErr; }
69 bool GetError() { return bError; }
73 /// Export strings from *.xrm and description.xml files
74 class XRMResExport : public XRMResParser
76 private:
77 ResData *pResData;
78 OString sPath;
79 PoOfstream pOutputStream;
80 protected:
81 void WorkOnDesc(
82 const OString &rOpenTag,
83 OString &rText
84 ) SAL_OVERRIDE;
85 void WorkOnText(
86 const OString &rOpenTag,
87 OString &rText
88 ) SAL_OVERRIDE;
89 void EndOfText(
90 const OString &rOpenTag,
91 const OString &rCloseTag
92 ) SAL_OVERRIDE;
93 void Output( const OString& rOutput ) SAL_OVERRIDE;
95 public:
96 XRMResExport(
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
107 private:
108 MergeDataFile *pMergeDataFile;
109 OString sFilename;
110 ResData *pResData;
111 std::ofstream pOutputStream;
112 std::vector<OString> aLanguages;
114 protected:
115 void WorkOnDesc(
116 const OString &rOpenTag,
117 OString &rText
118 ) SAL_OVERRIDE;
119 void WorkOnText(
120 const OString &rOpenTag,
121 OString &rText
122 ) SAL_OVERRIDE;
123 void EndOfText(
124 const OString &rOpenTag,
125 const OString &rCloseTag
126 ) SAL_OVERRIDE;
127 void Output( const OString& rOutput ) SAL_OVERRIDE;
128 public:
129 XRMResMerge(
130 const OString &rMergeSource,
131 const OString &rOutputFile,
132 const OString &rFilename
134 virtual ~XRMResMerge();
137 #endif // INCLUDED_L10NTOOLS_INC_XRMMERGE_HXX
139 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */