1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xrmmerge.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
32 #include <tools/string.hxx>
49 ByteString sCurrentOpenTag
;
50 ByteString sCurrentCloseTag
;
51 ByteString sCurrentText
;
52 std::vector
<ByteString
> aLanguages
;
55 ByteString
GetAttribute( const ByteString
&rToken
, const ByteString
&rAttribute
);
56 void Error( const ByteString
&rError
);
58 virtual void Output( const ByteString
& rOutput
)=0;
59 virtual void WorkOnText(
60 const ByteString
&rOpenTag
,
63 virtual void EndOfText(
64 const ByteString
&rOpenTag
,
65 const ByteString
&rCloseTag
68 ByteString
GetGID() { return sGID
; }
69 ByteString
GetLID() { return sLID
; }
71 void ConvertStringToDBFormat( ByteString
&rString
);
72 void ConvertStringToXMLFormat( ByteString
&rString
);
76 virtual ~XRMResParser();
78 int Execute( int nToken
, char * pToken
);
80 void SetError( BOOL bErr
= TRUE
) { bError
= bErr
; }
81 BOOL
GetError() { return bError
; }
85 // class XRMResOutputParser
88 class XRMResOutputParser
: public XRMResParser
91 std::vector
<ByteString
> aLanguages
;
93 SvFileStream
*pOutputStream
;
95 XRMResOutputParser ( const ByteString
&rOutputFile
);
96 virtual ~XRMResOutputParser();
103 class XRMResExport
: public XRMResOutputParser
109 std::vector
<ByteString
> aLanguages
;
113 const ByteString
&rOpenTag
,
117 const ByteString
&rOpenTag
,
118 const ByteString
&rCloseTag
120 void Output( const ByteString
& rOutput
);
124 const ByteString
&rOutputFile
,
125 const ByteString
&rProject
,
126 const ByteString
&rFilePath
128 virtual ~XRMResExport();
135 class XRMResMerge
: public XRMResOutputParser
138 MergeDataFile
*pMergeDataFile
;
139 ByteString sFilename
;
141 std::vector
<ByteString
> aLanguages
;
145 const ByteString
&rOpenTag
,
149 const ByteString
&rOpenTag
,
150 const ByteString
&rCloseTag
152 void Output( const ByteString
& rOutput
);
155 const ByteString
&rMergeSource
,
156 const ByteString
&rOutputFile
,
157 ByteString
&rFilename
159 virtual ~XRMResMerge();