merge the formfield patch from ooo-build
[ooovba.git] / sw / source / filter / inc / fltbase.hxx
blobb774cf0f6b41d0767f76e36221671418f35abd1f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fltbase.hxx,v $
10 * $Revision: 1.3 $
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 ************************************************************************/
30 #ifndef __FLTBASE_HXX__
31 #define __FLTBASE_HXX__
33 #include <tools/stream.hxx>
34 #include <tools/string.hxx>
36 class SwFilterBase
38 protected:
39 SvStream *pIn;
40 sal_Char *pReadBuff; // Groessenangabe
41 INT32 nBytesLeft; // noch zu lesende Bytes des aktuelle Records
43 CharSet eQuellChar; // Quell-Zeichensatz (interner Zeichensatz)
44 // CharSet eZielChar; // Ziel-Zeichensatz
46 USHORT nTab; // z.Zt. bearbeitete Tabelle
47 USHORT nReadBuffSize;// temporaerer Lesepuffer mit
49 // ----------------------------------------------------------
50 inline void ReadChar( char &rC );
51 inline void ReadByte( BYTE &rN );
52 inline void Read( short &rN );
53 inline void ReadUnicode( sal_Unicode &rU );
54 inline void Read( BYTE &rN0, USHORT &rN1, USHORT &rN2 );
55 inline void Read( USHORT &rN );
56 inline void Read( USHORT &rN1, USHORT &rN2 );
57 inline void Read( USHORT &rN1, USHORT &rN2, USHORT &rN3, USHORT &rN4 );
58 inline void Read( double &rF );
59 void Read( String &rS ); // liest 0-terminierten C-String!
60 inline void ClearBytesLeft( void );
64 inline void SwFilterBase::ReadChar( char &rC )
66 *pIn >> rC;
67 nBytesLeft--;
70 inline void SwFilterBase::ReadByte( BYTE &rN )
72 *pIn >> rN;
73 nBytesLeft--;
76 inline void SwFilterBase::ReadUnicode( sal_Unicode &rU )
79 sal_Char cC;
80 *pIn >> cC;
81 rU = ByteString::ConvertToUnicode(cC, eQuellChar);
82 nBytesLeft--;
86 inline void SwFilterBase::Read( short &rN )
88 *pIn >> rN;
89 nBytesLeft -= 2;
92 inline void SwFilterBase::Read( BYTE &rN0, USHORT &rN1, USHORT &rN2 )
94 *pIn >> rN0 >> rN1 >> rN2;
95 nBytesLeft -= 5;
98 inline void SwFilterBase::Read( USHORT &rN )
100 *pIn >> rN;
101 nBytesLeft -= 2;
104 inline void SwFilterBase::Read( USHORT &rN1, USHORT &rN2 )
106 *pIn >> rN1 >> rN2;
107 nBytesLeft -= 4;
110 inline void SwFilterBase::Read( USHORT &rN1, USHORT &rN2, USHORT &rN3, USHORT &rN4 )
112 *pIn >> rN1 >> rN2 >> rN3 >> rN4;
113 nBytesLeft -= 8;
116 inline void SwFilterBase::Read( double &rF )
118 *pIn >> rF;
119 nBytesLeft -= 8;
122 inline void SwFilterBase::ClearBytesLeft( void )
124 pIn->SeekRel( nBytesLeft );
125 nBytesLeft = 0;
129 #endif