Loading src/TNL/base64.h +6 −5 Original line number Diff line number Diff line Loading @@ -202,7 +202,8 @@ decode( const char* data, const std::size_t data_size ) * byte length of the data. The type of the byte length value is `HeaderType`. */ template< typename HeaderType = std::uint64_t, typename T > void write_encoded_block(const T* data, const std::size_t data_length, std::ostream& output_stream) void write_encoded_block( const T* data, const std::size_t data_length, std::ostream& output_stream ) { const HeaderType size = data_length * sizeof(T); std::unique_ptr<char[]> encoded_size = base64::encode( reinterpret_cast<const std::uint8_t*>(&size), sizeof(HeaderType) ); Loading src/TNL/zlib_compression.h +119 −119 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ namespace TNL { /** * Use zlib to compress the data, then encode it with base64 and write the * result to the given stream. * \brief Use zlib to compress the data, then encode it with base64 and write * the result to the given stream. * * Options for compression_level: * - Z_NO_COMPRESSION Loading Loading @@ -77,8 +77,8 @@ write_compressed_block(const T* data, } /** * Decompress data in given byte array and return an array of elements of * type T and length data_size. * \brief Decompress data in given byte array and return an array of elements of * type \e T and length \e data_size. */ template< typename T > std::unique_ptr<T[]> Loading @@ -105,11 +105,11 @@ decompress_data(const std::uint8_t* decoded_data, const std::size_t decoded_data } /** * Decode and decompress data from a stream. The data must be in the format * as produced by the write_compressed_block function. * \brief Decode and decompress data from a stream. The data must be in the * format as produced by the \ref write_compressed_block function. * * The function returns a pair of the resulting data size and a unique_ptr to * the data. * The function returns a pair of the resulting data size and a \ref std::unique_ptr * to the data. */ template< typename HeaderType = std::uint64_t, typename T > std::pair<HeaderType, std::unique_ptr<T[]>> Loading Loading @@ -140,11 +140,11 @@ decompress_block(const char* data) } /** * Decode and decompress data from a stream. The data must be in the format * as produced by the write_compressed_block function. * \brief Decode and decompress data from a stream. The data must be in the * format as produced by the \ref write_compressed_block function. * * The function returns a pair of the resulting data size and a unique_ptr to * the data. * The function returns a pair of the resulting data size and a \ref std::unique_ptr * to the data. */ template< typename HeaderType = std::uint64_t, typename T > std::pair< HeaderType, std::unique_ptr<T[]> > Loading Loading
src/TNL/base64.h +6 −5 Original line number Diff line number Diff line Loading @@ -202,7 +202,8 @@ decode( const char* data, const std::size_t data_size ) * byte length of the data. The type of the byte length value is `HeaderType`. */ template< typename HeaderType = std::uint64_t, typename T > void write_encoded_block(const T* data, const std::size_t data_length, std::ostream& output_stream) void write_encoded_block( const T* data, const std::size_t data_length, std::ostream& output_stream ) { const HeaderType size = data_length * sizeof(T); std::unique_ptr<char[]> encoded_size = base64::encode( reinterpret_cast<const std::uint8_t*>(&size), sizeof(HeaderType) ); Loading
src/TNL/zlib_compression.h +119 −119 Original line number Diff line number Diff line Loading @@ -20,8 +20,8 @@ namespace TNL { /** * Use zlib to compress the data, then encode it with base64 and write the * result to the given stream. * \brief Use zlib to compress the data, then encode it with base64 and write * the result to the given stream. * * Options for compression_level: * - Z_NO_COMPRESSION Loading Loading @@ -77,8 +77,8 @@ write_compressed_block(const T* data, } /** * Decompress data in given byte array and return an array of elements of * type T and length data_size. * \brief Decompress data in given byte array and return an array of elements of * type \e T and length \e data_size. */ template< typename T > std::unique_ptr<T[]> Loading @@ -105,11 +105,11 @@ decompress_data(const std::uint8_t* decoded_data, const std::size_t decoded_data } /** * Decode and decompress data from a stream. The data must be in the format * as produced by the write_compressed_block function. * \brief Decode and decompress data from a stream. The data must be in the * format as produced by the \ref write_compressed_block function. * * The function returns a pair of the resulting data size and a unique_ptr to * the data. * The function returns a pair of the resulting data size and a \ref std::unique_ptr * to the data. */ template< typename HeaderType = std::uint64_t, typename T > std::pair<HeaderType, std::unique_ptr<T[]>> Loading Loading @@ -140,11 +140,11 @@ decompress_block(const char* data) } /** * Decode and decompress data from a stream. The data must be in the format * as produced by the write_compressed_block function. * \brief Decode and decompress data from a stream. The data must be in the * format as produced by the \ref write_compressed_block function. * * The function returns a pair of the resulting data size and a unique_ptr to * the data. * The function returns a pair of the resulting data size and a \ref std::unique_ptr * to the data. */ template< typename HeaderType = std::uint64_t, typename T > std::pair< HeaderType, std::unique_ptr<T[]> > Loading