Add ARM Thumb mutex implementation from a "arm-thumb-mutex.patch"
[LibreOffice.git] / l10ntools / inc / xrmmerge.hxx
blob496adc16615c188189f9af7097ab198a19565a68
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 // global includes
30 #include <tools/string.hxx>
33 // XRMResParser
36 class XRMResParser
38 private:
39 ByteString sGID;
40 ByteString sLID;
42 sal_Bool bError;
43 sal_Bool bText;
45 bool sLocalized;
47 ByteString sCurrentOpenTag;
48 ByteString sCurrentCloseTag;
49 ByteString sCurrentText;
50 std::vector<ByteString> aLanguages;
52 protected:
53 ByteString GetAttribute( const ByteString &rToken, const ByteString &rAttribute );
54 void Error( const ByteString &rError );
56 virtual void Output( const ByteString& rOutput )=0;
57 virtual void WorkOnDesc(
58 const ByteString &rOpenTag,
59 ByteString &rText
60 )=0;
61 virtual void WorkOnText(
62 const ByteString &rOpenTag,
63 ByteString &rText
64 )=0;
65 virtual void EndOfText(
66 const ByteString &rOpenTag,
67 const ByteString &rCloseTag
68 )=0;
70 ByteString GetGID() { return sGID; }
71 ByteString GetLID() { return sLID; }
73 void ConvertStringToDBFormat( ByteString &rString );
74 void ConvertStringToXMLFormat( ByteString &rString );
76 public:
77 XRMResParser();
78 virtual ~XRMResParser();
80 int Execute( int nToken, char * pToken );
82 void SetError( sal_Bool bErr = sal_True ) { bError = bErr; }
83 sal_Bool GetError() { return bError; }
87 // class XRMResOutputParser
90 class XRMResOutputParser : public XRMResParser
92 private:
93 std::vector<ByteString> aLanguages;
94 protected:
95 SvFileStream *pOutputStream;
96 public:
97 XRMResOutputParser ( const ByteString &rOutputFile );
98 virtual ~XRMResOutputParser();
102 // XRMResExport
105 class XRMResExport : public XRMResOutputParser
107 private:
108 ResData *pResData;
109 ByteString sPrj;
110 ByteString sPath;
111 std::vector<ByteString> aLanguages;
113 protected:
114 void WorkOnDesc(
115 const ByteString &rOpenTag,
116 ByteString &rText
118 void WorkOnText(
119 const ByteString &rOpenTag,
120 ByteString &rText
122 void EndOfText(
123 const ByteString &rOpenTag,
124 const ByteString &rCloseTag
126 void Output( const ByteString& rOutput );
128 public:
129 XRMResExport(
130 const ByteString &rOutputFile,
131 const ByteString &rProject,
132 const ByteString &rFilePath
134 virtual ~XRMResExport();
138 // class XRMResMerge
141 class XRMResMerge : public XRMResOutputParser
143 private:
144 MergeDataFile *pMergeDataFile;
145 ByteString sFilename;
146 ResData *pResData;
147 std::vector<ByteString> aLanguages;
149 protected:
150 void WorkOnDesc(
151 const ByteString &rOpenTag,
152 ByteString &rText
154 void WorkOnText(
155 const ByteString &rOpenTag,
156 ByteString &rText
158 void EndOfText(
159 const ByteString &rOpenTag,
160 const ByteString &rCloseTag
162 void Output( const ByteString& rOutput );
163 public:
164 XRMResMerge(
165 const ByteString &rMergeSource,
166 const ByteString &rOutputFile,
167 ByteString &rFilename
169 virtual ~XRMResMerge();
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */