23 #ifndef __ccxx_ByteOrder_hxx 24 #define __ccxx_ByteOrder_hxx 29 #include <netinet/in.h> 52 static uint64_t hostToNetwork(uint64_t n);
63 static uint64_t networkToHost(uint64_t n);
71 static bool isBigEndian();
80 {
return(!isBigEndian()); }
99 _reverseBytes(reinterpret_cast<byte_t*>(&value),
sizeof(T));
105 static void _reverseBytes(
byte_t* buf,
size_t length);
113 #endif // __ccxx_ByteOrder_hxx static Endianness getEndianness()
Get the endianness of the host system.
Definition: ByteOrder.h++:87
static uint16_t networkToHost(uint16_t n)
Convert an unsigned 16-bit integer from network to host byte-order.
Definition: ByteOrder.h++:55
static bool isLittleEndian()
Determine if the host system is little-endian.
Definition: ByteOrder.h++:79
Big-endian (network byte order).
Definition: Common.h++:323
Byte-order conversion routines.
Definition: ByteOrder.h++:39
static uint32_t hostToNetwork(uint32_t n)
Convert an unsigned 32-bit integer from host to network byte-order.
Definition: ByteOrder.h++:48
static uint16_t hostToNetwork(uint16_t n)
Convert an unsigned 16-bit integer from host to network byte-order.
Definition: ByteOrder.h++:44
#define COMMONCPP_API
Definition: Common.h++:126
static T & reverseBytes(T &value)
Reverse the bytes in a value.
Definition: ByteOrder.h++:97
#define CCXX_COPY_DECLS(CLASS)
Inlines declarations of a copy constructor and assignment operator for the class CLASS.
Definition: Common.h++:295
Endianness
Byte endianness.
Definition: Common.h++:321
Definition: AllocationMap.c++:25
Little-endian.
Definition: Common.h++:325
static uint32_t networkToHost(uint32_t n)
Convert an unsigned 32-bit integer from network to host byte-order.
Definition: ByteOrder.h++:59
unsigned char byte_t
An unsigned 8-bit value.
Definition: Integers.h++:68