Strict Endianness,让程序(而非机器)决定文件的端序。
Strict Endianness 是一个 C 库,用于在读取和写入二进制数据时指定端序。它支持大端序(Big Endian)和小端序(Little Endian),并且可以在运行时动态选择端序。
Strict Endianness 的主要功能包括:
- 读取和写入二进制数据时指定端序
- 支持大端序和小端序
- 在运行时动态选择端序
- 提供简单的 API 来处理不同端序的数据
Strict Endianness 包含以下函数:
sf_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 写入指定端序的数据sf_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 读取指定端序的数据sf_open: 打开文件并指定端序sf_close: 关闭文件sf_set_buffer: 设置缓冲区大小_sf_raw_read: 辅助原始读sf_seek: 定位文件指针sf_tell: 获取当前文件指针位置sf_align: 对齐数据sf_write_string: 写入字符串sf_read_string: 读取字符串strict_flush: 刷新缓冲区sm_open: 打开内存缓冲区sm_close: 关闭内存缓冲区sm_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 写入内存缓冲区sm_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: 读取内存缓冲区sm_seek: 定位内存缓冲区指针sm_write_string: 写入字符串到内存缓冲区
Strict Endianness 兼容以下 C/C++ 编译器:
- GCC
- Clang
- MSVC
Strict Endianness 兼容以下 C/C++ 标准:
- C99
- C11
- C17
- C23
- C++98
- C++03
- C++11
- C++14
- C++17
- C++20
- C++23
- 此外,接下来的 C/C++ 标准也将继续兼容 Strict Endianness。
Strict Endianness allows the program (not the machine) to determine the endianness of files.
Strict Endianness is a C library for specifying endianness when reading and writing binary data. It supports both big-endian and little-endian formats and allows dynamic selection of endianness at runtime.
The main features of Strict Endianness include:
- Specifying endianness when reading and writing binary data
- Support for both big-endian and little-endian formats
- Dynamic selection of endianness at runtime
- Providing a simple API for handling data with different endianness
Strict Endianness includes the following functions:
sf_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Write data with specified endiannesssf_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Read data with specified endiannesssf_open: Open a file and specify endiannesssf_close: Close a filesf_set_buffer: Set buffer size_sf_raw_read: Helper for raw readingsf_seek: Seek file pointersf_tell: Get current file pointer positionsf_align: Align datasf_write_string: Write a stringsf_read_string: Read a stringstrict_flush: Flush the buffersm_open: Open a memory buffersm_close: Close a memory buffersm_write_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Write to memory buffersm_read_i8/u8/i16/u16/i32/u32/i64/u64/f32/f64: Read from memory buffersm_seek: Seek memory buffer pointersm_write_string: Write a string to memory buffer
Strict Endianness is compatible with the following C/C++ compilers:
- GCC
- Clang
- MSVC
Strict Endianness is compatible with the following C/C++ standards:
- C99
- C11
- C17
- C23
- C++98
- C++03
- C++11
- C++14
- C++17
- C++20
- C++23
- Additionally, future C/C++ standards will continue to be compatible with Strict Endianness.