ON_CompressedBuffer Class Reference

#include <opennurbs_compress.h>

Public Member Functions

 ON_CompressedBuffer ()
 
 ON_CompressedBuffer (const ON_CompressedBuffer &src)
 
 ~ON_CompressedBuffer ()
 
bool Compress (size_t sizeof__inbuffer, const void *inbuffer, int sizeof_element)
 Compress inbuffer. More...
 
bool CompressionEnd (struct ON_CompressedBufferHelper *) const
 
bool CompressionInit (struct ON_CompressedBufferHelper *) const
 
size_t DeflateHelper (struct ON_CompressedBufferHelper *, size_t sizeof___inbuffer, const void *in___buffer)
 
void Destroy ()
 Destroy the current informtion in the ON_CompressedBuffer so the class can be reused. More...
 
bool InflateHelper (struct ON_CompressedBufferHelper *, size_t sizeof___outbuffer, void *out___buffer) const
 
ON_CompressedBufferoperator= (const ON_CompressedBuffer &src)
 
bool Read (ON_BinaryArchive &binary_archive)
 
size_t SizeOfUncompressedBuffer () const
 
bool Uncompress (void *outbuffer, int *bFailedCRC) const
 Uncompress the contents of this ON_CompressedBuffer. More...
 
bool Write (ON_BinaryArchive &binary_archive) const
 
bool WriteChar (size_t count, const void *buffer)
 

Public Attributes

void * m_buffer_compressed
 
size_t m_buffer_compressed_capacity
 
ON__UINT32 m_crc_compressed
 
ON__UINT32 m_crc_uncompressed
 
int m_method
 
size_t m_sizeof_compressed
 
int m_sizeof_element
 
size_t m_sizeof_uncompressed
 

Constructor & Destructor Documentation

◆ ON_CompressedBuffer() [1/2]

ON_CompressedBuffer::ON_CompressedBuffer ( )

◆ ~ON_CompressedBuffer()

ON_CompressedBuffer::~ON_CompressedBuffer ( )

◆ ON_CompressedBuffer() [2/2]

ON_CompressedBuffer::ON_CompressedBuffer ( const ON_CompressedBuffer src)

Member Function Documentation

◆ Compress()

bool ON_CompressedBuffer::Compress ( size_t  sizeof__inbuffer,
const void *  inbuffer,
int  sizeof_element 
)

Compress inbuffer.

Parameters
sizeof__inbuffer[in] Number of bytes in inbuffer.
inbuffer[in] Uncompressed information.
sizeof_element[out] This parameter only matters if the buffer will be compressed, and decompressed on CPUs with different endianness. If this is the case, then the types in the buffer need to have the same size (2,4, or 8).
Returns
True if inbuffer is successfully compressed.

◆ CompressionEnd()

bool ON_CompressedBuffer::CompressionEnd ( struct ON_CompressedBufferHelper *  ) const

◆ CompressionInit()

bool ON_CompressedBuffer::CompressionInit ( struct ON_CompressedBufferHelper *  ) const

◆ DeflateHelper()

size_t ON_CompressedBuffer::DeflateHelper ( struct ON_CompressedBufferHelper *  ,
size_t  sizeof___inbuffer,
const void *  in___buffer 
)

◆ Destroy()

void ON_CompressedBuffer::Destroy ( )

Destroy the current informtion in the ON_CompressedBuffer so the class can be reused.

◆ InflateHelper()

bool ON_CompressedBuffer::InflateHelper ( struct ON_CompressedBufferHelper *  ,
size_t  sizeof___outbuffer,
void *  out___buffer 
) const

◆ operator=()

ON_CompressedBuffer& ON_CompressedBuffer::operator= ( const ON_CompressedBuffer src)

◆ Read()

bool ON_CompressedBuffer::Read ( ON_BinaryArchive binary_archive)

◆ SizeOfUncompressedBuffer()

size_t ON_CompressedBuffer::SizeOfUncompressedBuffer ( ) const
Returns
Number of bytes in the uncompressed information.

◆ Uncompress()

bool ON_CompressedBuffer::Uncompress ( void *  outbuffer,
int *  bFailedCRC 
) const

Uncompress the contents of this ON_CompressedBuffer.

Parameters
outbuffer[in/out] This buffer must have at least SizeOfUncompressedBuffer() bytes. If the function returns true, then the uncopressed information is stored in this buffer.
bFailedCRC[out] If not null, then this boolean is set to true if the CRC of the uncompressed information has changed.
Returns
True if uncompressed information is returned in outbuffer.

◆ Write()

bool ON_CompressedBuffer::Write ( ON_BinaryArchive binary_archive) const

◆ WriteChar()

bool ON_CompressedBuffer::WriteChar ( size_t  count,
const void *  buffer 
)

Member Data Documentation

◆ m_buffer_compressed

void* ON_CompressedBuffer::m_buffer_compressed

◆ m_buffer_compressed_capacity

size_t ON_CompressedBuffer::m_buffer_compressed_capacity

◆ m_crc_compressed

ON__UINT32 ON_CompressedBuffer::m_crc_compressed

◆ m_crc_uncompressed

ON__UINT32 ON_CompressedBuffer::m_crc_uncompressed

◆ m_method

int ON_CompressedBuffer::m_method

◆ m_sizeof_compressed

size_t ON_CompressedBuffer::m_sizeof_compressed

◆ m_sizeof_element

int ON_CompressedBuffer::m_sizeof_element

◆ m_sizeof_uncompressed

size_t ON_CompressedBuffer::m_sizeof_uncompressed