3 #ifndef INCLUDE_NN_NLIB_OSS_LZ4INPUTSTREAM_H_
4 #define INCLUDE_NN_NLIB_OSS_LZ4INPUTSTREAM_H_
12 #if defined(_MSC_VER) && defined(nx_oss_lz4_EXPORTS)
13 #undef NLIB_VIS_PUBLIC
14 #define NLIB_VIS_PUBLIC NLIB_WINEXPORT
20 class Lz4OutputStreamSettings;
28 virtual
errno_t Transform(OutputStream* os, const
void* p,
size_t nBytes,
30 virtual
void* GetWorkBuffer(
size_t* n)
NLIB_NOEXCEPT NLIB_OVERRIDE;
37 LZ4F_compressionContext_t m_Ctx;
38 unsigned char* m_BufOut;
42 unsigned char m_Header[16];
43 unsigned char m_BaseBuf[256];
54 m_Pref.frameInfo.blockMode = LZ4F_blockLinked;
55 m_Pref.compressionLevel = 9;
59 m_Pref.frameInfo.contentSize = size;
62 return m_Pref.frameInfo.contentSize;
69 m_Pref.compressionLevel = level;
72 return m_Pref.compressionLevel;
75 m_Pref.frameInfo.blockSizeID = max_block_size;
78 return m_Pref.frameInfo.blockSizeID;
81 m_Pref.frameInfo.blockMode = independence ? LZ4F_blockIndependent : LZ4F_blockLinked;
84 return (m_Pref.frameInfo.blockMode != LZ4F_blockLinked);
88 LZ4F_preferences_t m_Pref;
89 friend class detail::Lz4OutputTransform;
99 return this->Init(settings);
102 return m_Transform.Init(settings);
112 #if defined(_MSC_VER) && defined(nx_oss_lz4_EXPORTS)
113 #undef NLIB_VIS_PUBLIC
114 #define NLIB_VIS_PUBLIC NLIB_WINIMPORT
117 #endif // INCLUDE_NN_NLIB_OSS_LZ4INPUTSTREAM_H_
bool GetBlockIndependence() const noexcept
Gets the value specified with SetBlockIndependence(). The default is false.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
Lz4OutputStreamSettings() noexcept
Instantiates the object with default parameters (default constructor).
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
#define NLIB_OVERRIDE
Defines override if it is available for use. If not, holds an empty string.
~Lz4OutputStreamSettings() noexcept
Destructor.
LZ4F_blockSizeID_t GetMaxBlockSize() const noexcept
Gets the value specified with SetMaxBlockSize(). The default is LZ4F_default.
void SetMaxBlockSize(LZ4F_blockSizeID_t max_block_size) noexcept
Sets the maximum data block size. The larger the size, the higher the speed, though more memory is re...
void SetContentSize(uint64_t size) noexcept
Data with the size before compression can be included in data compressed with LZ4.
The class for holding the OutputTransform derived class.
errno_t Init(const Lz4OutputStreamSettings &settings) noexcept
Initializes a stream.
The class to obtain and configure the Lz4OutputStream settings.
errno_t Init() noexcept
Initializes the stream with the default settings.
uint64_t GetContentSize() const noexcept
Gets the value specified with SetContentSize(). The default is 0.
A file that contains the configuration information for each development environment.
void SetBlockIndependence(bool independence) noexcept
Sets whether a compressed data block can be uncompressed independently.
The stream class to write data according to the LZ4 frame format.
Defines the base class for output streams.
int GetCompressionLevel() noexcept
Gets the value specified with SetCompressionLevel(). The default is 9.
void SetCompressionLevel(int level) noexcept
Sets a compression level. The compression rate is an integer in a range from 0 to 16...