Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::IO::Compressor Class Referenceabstract

#include <Compressor.h>

Inherited by AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

Public Types

typedef AZ::u64 SizeType
 

Public Member Functions

virtual ~Compressor ()
 When we open a stream to check if it's compressed we read the first m_maxHeaderSize bytes.
 
virtual AZ::u32 GetTypeId () const =0
 Return compressor type id.
 
virtual bool ReadHeaderAndData (CompressorStream *stream, AZ::u8 *data, unsigned int dataSize)=0
 Called when we open a stream to Read for the first time. Data contains the first. dataSize <= m_maxHeaderSize.
 
virtual bool WriteHeaderAndData (CompressorStream *stream)
 Called when we are about to start writing to a compressed stream. (Must be called first to write compressor header)
 
virtual SizeType Read (CompressorStream *stream, SizeType byteSize, SizeType offset, void *buffer)=0
 Forwarded function from the Device when we from a compressed stream.
 
virtual SizeType Write (CompressorStream *stream, SizeType byteSize, const void *data, SizeType offset=SizeType(-1))=0
 Forwarded function from the Device when we write to a compressed stream.
 
virtual bool WriteSeekPoint (CompressorStream *stream)
 Write a seek point.
 
virtual bool StartCompressor (CompressorStream *stream, int compressionLevel, SizeType autoSeekDataSize)
 Initializes Compressor for writing data.
 
virtual bool Close (CompressorStream *stream)=0
 Called just before we close the stream. All compression data will be flushed and finalized. (You can't add data afterwards).
 

Static Public Attributes

static const int m_maxHeaderSize = 4096
 

Detailed Description

Compressor/Decompressor base interface. Used for all stream compressors.

Member Function Documentation

◆ Close()

virtual bool AZ::IO::Compressor::Close ( CompressorStream stream)
pure virtual

Called just before we close the stream. All compression data will be flushed and finalized. (You can't add data afterwards).

Implemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ GetTypeId()

virtual AZ::u32 AZ::IO::Compressor::GetTypeId ( ) const
pure virtual

Return compressor type id.

Implemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ Read()

virtual SizeType AZ::IO::Compressor::Read ( CompressorStream stream,
SizeType  byteSize,
SizeType  offset,
void *  buffer 
)
pure virtual

Forwarded function from the Device when we from a compressed stream.

Implemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ ReadHeaderAndData()

virtual bool AZ::IO::Compressor::ReadHeaderAndData ( CompressorStream stream,
AZ::u8 *  data,
unsigned int  dataSize 
)
pure virtual

Called when we open a stream to Read for the first time. Data contains the first. dataSize <= m_maxHeaderSize.

Implemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ StartCompressor()

virtual bool AZ::IO::Compressor::StartCompressor ( CompressorStream stream,
int  compressionLevel,
SizeType  autoSeekDataSize 
)
inlinevirtual

Initializes Compressor for writing data.

Reimplemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ Write()

virtual SizeType AZ::IO::Compressor::Write ( CompressorStream stream,
SizeType  byteSize,
const void *  data,
SizeType  offset = SizeType(-1) 
)
pure virtual

Forwarded function from the Device when we write to a compressed stream.

Implemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ WriteHeaderAndData()

virtual bool AZ::IO::Compressor::WriteHeaderAndData ( CompressorStream stream)
virtual

Called when we are about to start writing to a compressed stream. (Must be called first to write compressor header)

Reimplemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.

◆ WriteSeekPoint()

virtual bool AZ::IO::Compressor::WriteSeekPoint ( CompressorStream stream)
inlinevirtual

Write a seek point.

Reimplemented in AZ::IO::CompressorZLib, and AZ::IO::CompressorZStd.


The documentation for this class was generated from the following file: