equal
deleted
inserted
replaced
24 */ |
24 */ |
25 |
25 |
26 |
26 |
27 /* |
27 /* |
28 * |
28 * |
29 * (C) Copyright IBM Corp. 1998-2004 - All Rights Reserved |
29 * (C) Copyright IBM Corp. 1998-2005 - All Rights Reserved |
30 * |
30 * |
31 */ |
31 */ |
32 |
32 |
33 #ifndef __LESWAPS_H |
33 #ifndef __LESWAPS_H |
34 #define __LESWAPS_H |
34 #define __LESWAPS_H |
35 |
35 |
36 #include "LETypes.h" |
36 #include "LETypes.h" |
37 |
37 |
38 #if !defined(U_IS_BIG_ENDIAN) |
38 /** |
39 #ifdef _LITTLE_ENDIAN |
39 * \file |
40 #define U_IS_BIG_ENDIAN 0 |
40 * \brief C++ API: Endian independent access to data for LayoutEngine |
41 #endif |
41 */ |
42 #endif |
42 |
|
43 U_NAMESPACE_BEGIN |
43 |
44 |
44 /** |
45 /** |
45 * A convenience macro which invokes the swapWord member function |
46 * A convenience macro which invokes the swapWord member function |
46 * from a concise call. |
47 * from a concise call. |
47 * |
48 * |
48 * @stable ICU 2.8 |
49 * @stable ICU 2.8 |
49 */ |
50 */ |
50 |
|
51 #if defined(U_IS_BIG_ENDIAN) |
51 #if defined(U_IS_BIG_ENDIAN) |
52 #if U_IS_BIG_ENDIAN |
52 #if U_IS_BIG_ENDIAN |
53 #define SWAPW(value) (value) |
53 #define SWAPW(value) (value) |
54 #else |
54 #else |
55 #define SWAPW(value) LESwaps::swapWord(value) |
55 #define SWAPW(value) LESwaps::swapWord(value) |
62 * A convenience macro which invokes the swapLong member function |
62 * A convenience macro which invokes the swapLong member function |
63 * from a concise call. |
63 * from a concise call. |
64 * |
64 * |
65 * @stable ICU 2.8 |
65 * @stable ICU 2.8 |
66 */ |
66 */ |
67 |
|
68 #if defined(U_IS_BIG_ENDIAN) |
67 #if defined(U_IS_BIG_ENDIAN) |
69 #if U_IS_BIG_ENDIAN |
68 #if U_IS_BIG_ENDIAN |
70 #define SWAPL(value) (value) |
69 #define SWAPL(value) (value) |
71 #else |
70 #else |
72 #define SWAPL(value) LESwaps::swapLong(value) |
71 #define SWAPL(value) LESwaps::swapLong(value) |
84 * All methods are static and inline in an attempt to induce the compiler |
83 * All methods are static and inline in an attempt to induce the compiler |
85 * to do most of the calculations at compile time. |
84 * to do most of the calculations at compile time. |
86 * |
85 * |
87 * @stable ICU 2.8 |
86 * @stable ICU 2.8 |
88 */ |
87 */ |
89 class LESwaps |
88 class U_LAYOUT_API LESwaps /* not : public UObject because all methods are static */ { |
90 { |
|
91 public: |
89 public: |
92 |
90 |
93 #if !defined(U_IS_BIG_ENDIAN) |
91 #if !defined(U_IS_BIG_ENDIAN) |
94 /** |
92 /** |
95 * This method detects the endian-ness of the platform by |
93 * This method detects the endian-ness of the platform by |
142 |
140 |
143 private: |
141 private: |
144 LESwaps() {} // private - forbid instantiation |
142 LESwaps() {} // private - forbid instantiation |
145 }; |
143 }; |
146 |
144 |
|
145 U_NAMESPACE_END |
147 #endif |
146 #endif |