1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
29 #include <tools/string.hxx>
46 ByteString sCurrentOpenTag
;
47 ByteString sCurrentCloseTag
;
48 ByteString sCurrentText
;
49 std::vector
<ByteString
> aLanguages
;
52 ByteString
GetAttribute( const ByteString
&rToken
, const ByteString
&rAttribute
);
53 void Error( const ByteString
&rError
);
55 virtual void Output( const ByteString
& rOutput
)=0;
56 virtual void WorkOnText(
57 const ByteString
&rOpenTag
,
60 virtual void EndOfText(
61 const ByteString
&rOpenTag
,
62 const ByteString
&rCloseTag
65 ByteString
GetGID() { return sGID
; }
66 ByteString
GetLID() { return sLID
; }
68 void ConvertStringToDBFormat( ByteString
&rString
);
69 void ConvertStringToXMLFormat( ByteString
&rString
);
73 virtual ~XRMResParser();
75 int Execute( int nToken
, char * pToken
);
77 void SetError( BOOL bErr
= TRUE
) { bError
= bErr
; }
78 BOOL
GetError() { return bError
; }
82 // class XRMResOutputParser
85 class XRMResOutputParser
: public XRMResParser
88 std::vector
<ByteString
> aLanguages
;
90 SvFileStream
*pOutputStream
;
92 XRMResOutputParser ( const ByteString
&rOutputFile
);
93 virtual ~XRMResOutputParser();
100 class XRMResExport
: public XRMResOutputParser
106 std::vector
<ByteString
> aLanguages
;
110 const ByteString
&rOpenTag
,
114 const ByteString
&rOpenTag
,
115 const ByteString
&rCloseTag
117 void Output( const ByteString
& rOutput
);
121 const ByteString
&rOutputFile
,
122 const ByteString
&rProject
,
123 const ByteString
&rFilePath
125 virtual ~XRMResExport();
132 class XRMResMerge
: public XRMResOutputParser
135 MergeDataFile
*pMergeDataFile
;
136 ByteString sFilename
;
138 std::vector
<ByteString
> aLanguages
;
142 const ByteString
&rOpenTag
,
146 const ByteString
&rOpenTag
,
147 const ByteString
&rCloseTag
149 void Output( const ByteString
& rOutput
);
152 const ByteString
&rMergeSource
,
153 const ByteString
&rOutputFile
,
154 ByteString
&rFilename
156 virtual ~XRMResMerge();