![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cMem.h>
Static Public Member Functions | |
template<class TYPE > | |
static TYPE | ReverseType (TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | HtoN (TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | NtoH (TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | HtoLE (TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | LEtoH (TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | GetUnaligned (const void *pData) noexcept |
template<typename TYPE > | |
static void | SetUnaligned (void *pData, TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | GetLEtoH (const void *pData) noexcept |
template<typename TYPE > | |
static void | SetHtoLE (void *pData, TYPE nVal) noexcept |
template<typename TYPE > | |
static TYPE | GetNtoH (const void *pData) noexcept |
template<typename TYPE > | |
static void | SetHtoN (void *pData, TYPE nVal) noexcept |
static DWORD | GetNVal3 (const BYTE *p) noexcept |
static void | SetNVal3 (BYTE *p, DWORD nVal) noexcept |
template<> | |
WORD | ReverseType (WORD nVal) noexcept |
template<> | |
UINT32 | ReverseType (UINT32 nVal) noexcept |
template<> | |
UINT64 | ReverseType (UINT64 nVal) noexcept |
template<> | |
ULONG | ReverseType (ULONG nVal) noexcept |
![]() | |
template<class TYPE > | |
static void | Swap (TYPE &a, TYPE &b) noexcept |
template<class TYPE > | |
static COMPARE_t | Compare (const TYPE &a, const TYPE &b) noexcept |
template<> | |
COMPARE_t | Compare (const cTimeFile &t1, const cTimeFile &t2) |
collection of templates to handle An arbitrary value type in memory. cValT in heap, const or stack. Deal with it as an array of bytes.
|
inlinestaticnoexcept |
Get bytes packed as LE (Intel). ( Not "Network order" which is big endian.)
|
inlinestaticnoexcept |
Get bytes packed as BE (Network order, Not Intel). similar to CopyNtoH()
|
inlinestaticnoexcept |
Get 3 packed BYTEs as a host value. from Network order. Big Endian. opposite of SetNVal3()
|
inlinestaticnoexcept |
Get a data value from an unaligned TYPE pointer. Like the _WIN32 UNALIGNED macro.
Host byte order to little endian. (Intel)
Assume bytes are correct bit order but larger types are not ordered correctly.
Host byte order to network order (big endian). like htonl() htons()
Little Endian (Intel) to host byte order.
Assume bytes are correct bit order but larger types are not ordered correctly.
Network byte order (big endian) to host order. like ntohl() ntohs() Network order = BigEndian = High order comes first = Not Intel.
Reverse the byte order in an intrinsic type. Like GNUC __builtin_bswap16(), __builtin_bswap32, etc Similar to: ntohl(), htonl(), ntohs(), htons().
|
inlinestaticnoexcept |
Reverse the bytes in an intrinsic 32 bit type UINT32. like ntohl(),htonl()
|
inlinestaticnoexcept |
Reverse the bytes in an intrinsic 64 bit type UINT64.
|
inlinestaticnoexcept |
ULONG may be equiv to UINT32 or UINT64
|
inlinestaticnoexcept |
Reverse the bytes in an intrinsic 16 bit type WORD. e.g. 0x1234 = 0x3412 like ntohs(),htons(), MAKEWORD()
|
inlinestaticnoexcept |
Set bytes packed as LE (Intel). ( Not "Network order" which is big endian.)
|
inlinestaticnoexcept |
Set bytes packed as BE (Network order, Not Intel). similar to CopyHtoN()
|
inlinestaticnoexcept |
Set 3 packed BYTEs as a value. Network order. Big Endian. opposite of GetNVal3()
|
inlinestaticnoexcept |
Get a data value from an unaligned TYPE pointer. Like the _WIN32 UNALIGNED macro.