xref: /aoo42x/main/svl/unx/inc/convert.hxx (revision 39a19a47)
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 _CONVERT_HXX
24 #define _CONVERT_HXX
25 
26 /*
27 #define _SWAPSHORT(x) ((((x) & 0xFF00)>>8) | (((x) & 0x00FF)<<8))
28 #define _SWAPLONG(x)  ((((x) & 0xFF000000)>>24) | (((x) & 0x00FF0000)>>8) |  \
29 					  (((x) & 0x0000FF00)<<8) | (((x) & 0x000000FF)<<24))
30 */
31 class Convert
32 {
33 public:
Swap(long & nValue)34 	static void		Swap( long & nValue )
35 					{ nValue = SWAPLONG( nValue ); }
Swap(ULONG & nValue)36 	static void		Swap( ULONG & nValue )
37 					{ nValue = SWAPLONG( nValue ); }
Swap(short & nValue)38 	static void		Swap( short & nValue )
39 					{ nValue = SWAPSHORT( nValue ); }
Swap(USHORT & nValue)40 	static void		Swap( USHORT & nValue )
41 					{ nValue = SWAPSHORT( nValue ); }
Swap(Point & aPtr)42 	static void		Swap( Point & aPtr )
43 					{ Swap( aPtr.X() ); Swap( aPtr.Y() ); }
Swap(Size & aSize)44 	static void		Swap( Size & aSize )
45 					{ Swap( aSize.Width() ); Swap( aSize.Height() ); }
Swap(Rectangle & rRect)46 	static void		Swap( Rectangle & rRect )
47 					{ Swap( rRect.Top() ); Swap( rRect.Bottom() );
48 					  Swap( rRect.Left() ); Swap( rRect.Right() ); }
49 /*
50 	static USHORT	AnsiFloatSize() const { return 6; }
51 	static float	AnsiToFloat( void * pAnsiFloat )
52 					{ return 0; }
53 	static USHORT	AnsiDoubleSize() const { return 12; }
54 	static double	AnsiToDouble( void * pAnsiDouble )
55 					{ return 0; }
56 */
57 };
58 
59 #endif // _CONVERT_HXX
60