|
template<typename T = std::vector<uint8_t>>
requires (sizeof(typename T::value_type) == 1 && std::is_trivially_copyable_v<typename T::value_type>) |
| static bool | WriteFile (const std::filesystem::path &pathFileName, const T &tData) |
| | 从任意顺序容器写出字节流数据到指定文件名的文件中
|
template<typename T = std::vector<uint8_t>>
requires (sizeof(typename T::value_type) == 1 && std::is_trivially_copyable_v<typename T::value_type>) |
| static bool | ReadFile (const std::filesystem::path &pathFileName, T &tData) |
| | 从指定文件名的文件中读取字节流数据到任意顺序容器中
|
| static bool | IsFileExist (const std::filesystem::path &pathFileName) |
| | 判断指定文件名的文件是否存在
|
| static bool | IsZlib (uint8_t u8DataFirst, uint8_t u8DataSecond) |
| | 通过字节流开始的两个字节判断是否可能是Zlib压缩
|
| static bool | IsGzip (uint8_t u8DataFirst, uint8_t u8DataSecond) |
| | 通过字节流开始的两个字节判断是否可能是Gzip压缩
|
template<typename T>
requires (sizeof(typename T::value_type) == 1 && std::is_trivially_copyable_v<typename T::value_type>) |
| static bool | IsDataZipped (const T &tData) |
| | 判断一个顺序容器存储的字节流是否可能存在压缩
|
template<typename I, typename O>
requires (sizeof(typename I::value_type) == 1 && std::is_trivially_copyable_v<typename I::value_type> && sizeof(typename O::value_type) == 1 && std::is_trivially_copyable_v<typename O::value_type>) |
| static void | DecompressData (O &oData, const I &iData) |
| | 解压数据,自动判断Zlib或Gzip并解压,如果失败则抛出异常
|
template<typename I, typename O>
requires (sizeof(typename I::value_type) == 1 && std::is_trivially_copyable_v<typename I::value_type> && sizeof(typename O::value_type) == 1 && std::is_trivially_copyable_v<typename O::value_type>) |
| static void | CompressData (O &oData, const I &iData, int iLevel=Z_DEFAULT_COMPRESSION) |
| | 压缩数据,默认压缩为Gzip,也就是NBT格式的标准压缩类型,如果失败则抛出异常
|
template<typename I, typename O, typename ErrInfoFunc = NBT_Print>
requires (sizeof(typename I::value_type) == 1 && std::is_trivially_copyable_v<typename I::value_type> && sizeof(typename O::value_type) == 1 && std::is_trivially_copyable_v<typename O::value_type>) |
| static bool | DecompressDataNoThrow (O &oData, const I &iData, ErrInfoFunc funcErrInfo=NBT_Print{ stderr }) noexcept |
| | 解压数据,但是不抛出异常,而是通过funcErrInfo打印异常信息并返回成功与否
|
template<typename I, typename O, typename ErrInfoFunc = NBT_Print>
requires (sizeof(typename I::value_type) == 1 && std::is_trivially_copyable_v<typename I::value_type> && sizeof(typename O::value_type) == 1 && std::is_trivially_copyable_v<typename O::value_type>) |
| static bool | CompressDataNoThrow (O &oData, const I &iData, int iLevel=Z_DEFAULT_COMPRESSION, ErrInfoFunc funcErrInfo=NBT_Print{ stderr }) noexcept |
| | 压缩数据,但是不抛出异常,而是通过funcErrInfo打印异常信息并返回成功与否
|