diff options
Diffstat (limited to 'src/common/zstd_compression.h')
| -rw-r--r-- | src/common/zstd_compression.h | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/common/zstd_compression.h b/src/common/zstd_compression.h index e9de941c8..c26a30ab9 100644 --- a/src/common/zstd_compression.h +++ b/src/common/zstd_compression.h | |||
| @@ -13,24 +13,25 @@ namespace Common::Compression { | |||
| 13 | /** | 13 | /** |
| 14 | * Compresses a source memory region with Zstandard and returns the compressed data in a vector. | 14 | * Compresses a source memory region with Zstandard and returns the compressed data in a vector. |
| 15 | * | 15 | * |
| 16 | * @param source the uncompressed source memory region. | 16 | * @param source The uncompressed source memory region. |
| 17 | * @param source_size the size in bytes of the uncompressed source memory region. | 17 | * @param source_size The size of the uncompressed source memory region. |
| 18 | * @param compression_level the used compression level. Should be between 1 and 22. | 18 | * @param compression_level The used compression level. Should be between 1 and 22. |
| 19 | * | 19 | * |
| 20 | * @return the compressed data. | 20 | * @return the compressed data. |
| 21 | */ | 21 | */ |
| 22 | std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size, s32 compression_level); | 22 | [[nodiscard]] std::vector<u8> CompressDataZSTD(const u8* source, std::size_t source_size, |
| 23 | s32 compression_level); | ||
| 23 | 24 | ||
| 24 | /** | 25 | /** |
| 25 | * Compresses a source memory region with Zstandard with the default compression level and returns | 26 | * Compresses a source memory region with Zstandard with the default compression level and returns |
| 26 | * the compressed data in a vector. | 27 | * the compressed data in a vector. |
| 27 | * | 28 | * |
| 28 | * @param source the uncompressed source memory region. | 29 | * @param source The uncompressed source memory region. |
| 29 | * @param source_size the size in bytes of the uncompressed source memory region. | 30 | * @param source_size The size of the uncompressed source memory region. |
| 30 | * | 31 | * |
| 31 | * @return the compressed data. | 32 | * @return the compressed data. |
| 32 | */ | 33 | */ |
| 33 | std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size); | 34 | [[nodiscard]] std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_size); |
| 34 | 35 | ||
| 35 | /** | 36 | /** |
| 36 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. | 37 | * Decompresses a source memory region with Zstandard and returns the uncompressed data in a vector. |
| @@ -39,6 +40,6 @@ std::vector<u8> CompressDataZSTDDefault(const u8* source, std::size_t source_siz | |||
| 39 | * | 40 | * |
| 40 | * @return the decompressed data. | 41 | * @return the decompressed data. |
| 41 | */ | 42 | */ |
| 42 | std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); | 43 | [[nodiscard]] std::vector<u8> DecompressDataZSTD(const std::vector<u8>& compressed); |
| 43 | 44 | ||
| 44 | } // namespace Common::Compression \ No newline at end of file | 45 | } // namespace Common::Compression \ No newline at end of file |