xref: /aoo42x/main/tools/inc/tools/vcompat.hxx (revision 8b851043)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _VCOMPAT_HXX
24 #define _VCOMPAT_HXX
25 
26 #include "tools/toolsdllapi.h"
27 #include <tools/solar.h>
28 
29 // -----------
30 // - Defines -
31 // -----------
32 
33 #define COMPAT_FORMAT( char1, char2, char3, char4 ) \
34 	((sal_uInt32)((((sal_uInt32)(char)(char1)))|				\
35 	(((sal_uInt32)(char)(char2))<<8UL)|					\
36 	(((sal_uInt32)(char)(char3))<<16UL)|					\
37 	((sal_uInt32)(char)(char4))<<24UL))
38 
39 // --------------
40 // - ImplCompat -
41 // --------------
42 
43 class SvStream;
44 
45 class TOOLS_DLLPUBLIC VersionCompat
46 {
47     SvStream*		mpRWStm;
48     sal_uInt32			mnCompatPos;
49     sal_uInt32			mnTotalSize;
50     sal_uInt16			mnStmMode;
51     sal_uInt16			mnVersion;
52 
VersionCompat()53 					VersionCompat() {}
VersionCompat(const VersionCompat &)54 					VersionCompat( const VersionCompat& ) {}
operator =(const VersionCompat &)55     VersionCompat&	operator=( const VersionCompat& ) { return *this; }
operator ==(const VersionCompat &)56     sal_Bool			operator==( const VersionCompat& ) { return sal_False; }
57 
58 public:
59 
60 					VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 nVersion = 1 );
61 					~VersionCompat();
62 
GetVersion() const63     sal_uInt16			GetVersion() const { return mnVersion; }
64 };
65 
66 #endif // _VCOMPAT_HXX
67