Mobile API Reference  MicroStrategy 2019
Facilities.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : Facilities.h
3 // AUTHOR : Yi Luo
4 // CREATION : 07/12/2002
5 // Copyright (C) MicroStrategy, Inc. 2002
6 //==============================================================================================
7 
8 #ifndef Serialization_Facilities_H
9 #define Serialization_Facilities_H
10 
11 
12 #define const_swap2(x) \
13  ((unsigned short)( \
14  (((unsigned short)(x) & (unsigned short)0x00ffU) << 8) | \
15  (((unsigned short)(x) & (unsigned short)0xff00U) >> 8) ))
16 
17 #define const_swap4(x) \
18  ((unsigned int)( \
19  (((unsigned int)(x) & (unsigned int)0x000000ffUL) << 24) | \
20  (((unsigned int)(x) & (unsigned int)0x0000ff00UL) << 8) | \
21  (((unsigned int)(x) & (unsigned int)0x00ff0000UL) >> 8) | \
22  (((unsigned int)(x) & (unsigned int)0xff000000UL) >> 24) ))
23 
24 #define const_swap8(x) \
25  ((unsigned Int64)( \
26  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x00000000000000ff) ) << 56) | \
27  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x000000000000ff00) ) << 40) | \
28  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x0000000000ff0000) ) << 24) | \
29  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x00000000ff000000) ) << 8) | \
30  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x000000ff00000000) ) >> 8) | \
31  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x0000ff0000000000) ) >> 24) | \
32  (unsigned Int64)(((unsigned Int64)(x) & INT64(0x00ff000000000000) ) >> 40) | \
33  (unsigned Int64)(((unsigned Int64)(x) & INT64(0xff00000000000000) ) >> 56) ))
34 
35 
36 namespace MSerialization
37 {
38 
41 {
45 };
46 
47 bool MoreThan32Bit(Int64 iData);
48 
49 const unsigned char GN_Data_Stream_Flag = 0xBE;
50 
51 };
52 
53 #endif // Serialization_Facilities_H
Definition: Facilities.h:42
StreamType
Enumeration of different stream types.
Definition: Facilities.h:40
#define Int64
Definition: BasicTypes.h:36
!< Stream is serialized in memory
Definition: Facilities.h:43
const unsigned char GN_Data_Stream_Flag
Definition: Facilities.h:49
Definition: MultiReadStream.h:23
bool MoreThan32Bit(Int64 iData)
!< Stream is serialized into a file
Definition: Facilities.h:44