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 ************************************************************************/
30 #include <tools/string.hxx>
47 ByteString sCurrentOpenTag
;
48 ByteString sCurrentCloseTag
;
49 ByteString sCurrentText
;
50 std::vector
<ByteString
> aLanguages
;
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
,
61 virtual void WorkOnText(
62 const ByteString
&rOpenTag
,
65 virtual void EndOfText(
66 const ByteString
&rOpenTag
,
67 const ByteString
&rCloseTag
70 ByteString
GetGID() { return sGID
; }
71 ByteString
GetLID() { return sLID
; }
73 void ConvertStringToDBFormat( ByteString
&rString
);
74 void ConvertStringToXMLFormat( ByteString
&rString
);
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
93 std::vector
<ByteString
> aLanguages
;
95 SvFileStream
*pOutputStream
;
97 XRMResOutputParser ( const ByteString
&rOutputFile
);
98 virtual ~XRMResOutputParser();
105 class XRMResExport
: public XRMResOutputParser
111 std::vector
<ByteString
> aLanguages
;
115 const ByteString
&rOpenTag
,
119 const ByteString
&rOpenTag
,
123 const ByteString
&rOpenTag
,
124 const ByteString
&rCloseTag
126 void Output( const ByteString
& rOutput
);
130 const ByteString
&rOutputFile
,
131 const ByteString
&rProject
,
132 const ByteString
&rFilePath
134 virtual ~XRMResExport();
141 class XRMResMerge
: public XRMResOutputParser
144 MergeDataFile
*pMergeDataFile
;
145 ByteString sFilename
;
147 std::vector
<ByteString
> aLanguages
;
151 const ByteString
&rOpenTag
,
155 const ByteString
&rOpenTag
,
159 const ByteString
&rOpenTag
,
160 const ByteString
&rCloseTag
162 void Output( const ByteString
& rOutput
);
165 const ByteString
&rMergeSource
,
166 const ByteString
&rOutputFile
,
167 ByteString
&rFilename
169 virtual ~XRMResMerge();
172 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */