#include <stdio.h>
#include "assert.h"
Go to the source code of this file.
Namespaces | |
namespace | endian |
Functions | |
bool | endian::is_big_endian () |
Returns true if the host is big_endian (used only to initialize bool big ). | |
template<typename T> | |
size_t | endian::write8 (T v, FILE *file, bool write_big=false) |
Write 8-byte value in little-endian format. | |
template<typename T> | |
size_t | endian::read8 (T *buf, FILE *file, bool read_big=false) |
Read 8-byte value in little-endian format. | |
template<typename T> | |
size_t | endian::write4 (T v, FILE *file, bool write_big=false) |
Write 4-byte value in little-endian format. | |
template<typename T> | |
size_t | endian::read4 (T *buf, FILE *file, bool read_big=false) |
Read 4-byte value in little-endian format. | |
template<typename T> | |
size_t | endian::write2 (T v, FILE *file, bool write_big=false) |
Write 2-byte value in little-endian format. | |
template<typename T> | |
size_t | endian::read2 (T *buf, FILE *file, bool read_big=false) |
Read 2-byte value in little-endian format. | |
Variables | |
static const bool | endian::big = is_big_endian() |
Is this host big-endian. |