OROCHI
 
Loading...
Searching...
No Matches
GxZlib Class Reference

GxZlib圧縮・展開処理クラス More...

#include <GxZlib.h>

Classes

struct  GxEncodeHeader
 圧縮ヘッダー More...
 

Public Member Functions

初期化
 GxZlib (void)
 コンストラクタ
 
 ~GxZlib (void)
 デストラクタ
 
操作
RESULT decode (GxStreamReader &reader, void *pOutput, u32 outputSize)
 展開
 
RESULT decode (GxStreamReader &reader, GxMemoryStream *pOutput, b32 isAppend=false)
 展開 (展開先メモリストリーム指定)
 
RESULT encode (GxStreamWriter &writer, void *pInput, u32 inputSize, u32 level=ENCODE_LEVEL_DEFAULT)
 圧縮
 
RESULT encode (GxStreamWriter &writer, GxMemoryStream *pInput, u32 level=ENCODE_LEVEL_DEFAULT)
 圧縮 (圧縮元メモリストリーム指定)
 
void cancel (void)
 キャンセル
 
void clear (void)
 クリア
 

Static Public Member Functions

アクセサ
static b32 getEncodeHeader (GxEncodeHeader &dst, const void *pSrc)
 圧縮データヘッダー取得 (ポインタ指定)
 
static b32 getEncodeHeader (GxEncodeHeader &dst, const GxStreamReader &reader)
 圧縮データヘッダー取得 (ストリームリーダ指定)
 
static b32 readHeader (GxEncodeHeader &dst, GxStreamReader *pStreamReader)
 マニュアル操作用(内部使用のみ)
 
static void * createDecoderHandle (u32 chunkSizeByte)
 ハンドルを作成。失敗した場合は nullptr を返す
 
static b32 decodeByHandle (void *pHandle, GxStreamReader *pStreamReader, void *pOutput, u32 outputSize, u32 &encodeSize)
 pOutput が溜まるまでデコードする
 
static b32 deleteDecoderHandle (void *pHandle)
 ハンドルを削除する
 

定義

enum class  RESULT { CANCELED = -2 , ERROR_ = -1 , OK = 0 }
 処理結果 More...
 
static constexpr u32 DECODE_BUFFER_SIZE = GxMath::VALUE_64K
 展開バッファサイズ (byte)
 
static constexpr u32 ENCODE_LEVEL_DEFAULT = 7
 圧縮レベルディフォルト値 [0,9]
 
static constexpr u32 ENCODE_LEVEL_MAX = 9
 圧縮レベル最大値 [0,9]
 
static constexpr u32 FOURCC_CODE_ZLIB = GX_FOURCC('Z','L','I','B')
 FourCCコード
 

Detailed Description

GxZlib圧縮・展開処理クラス

Member Enumeration Documentation

◆ RESULT

enum class GxZlib::RESULT
strong

処理結果

Enumerator
CANCELED 

キャンセル

ERROR_ 

エラー

OK 

成功

Member Function Documentation

◆ createDecoderHandle()

void * GxZlib::createDecoderHandle ( u32 chunkSizeByte)
static

ハンドルを作成。失敗した場合は nullptr を返す

Parameters
chunkSizeByte[in] チャンクサイズを指定
Returns
ハンドルを返す。失敗した場合は nullptrを返す
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decode() [1/2]

GxZlib::RESULT GxZlib::decode ( GxStreamReader & reader,
GxMemoryStream * pOutput,
b32 isAppend = false )

展開 (展開先メモリストリーム指定)

Parameters
reader[in,out] 展開元入力ストリームリーダー
pOutput[in,out] 展開先出力メモリストリーム
isAppend[in] 追加フラグ
Returns
処理結果 (GxZlib::RESULT定義参照)
Note
追加フラグ isAppend が true の場合、出力メモリストリームに追記する形で展開処理を行います。
Here is the call graph for this function:

◆ decode() [2/2]

GxZlib::RESULT GxZlib::decode ( GxStreamReader & reader,
void * pOutput,
u32 outputSize )

展開

Parameters
reader[in,out] 展開元入力ストリームリーダー
pOutput[out] 展開先出力バッファポインタ
outputSize[in] 展開先出力バッファサイズ
Returns
処理結果 (GxZlib::RESULT定義参照)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decodeByHandle()

b32 GxZlib::decodeByHandle ( void * handle,
GxStreamReader * pStreamReader,
void * pOutput,
u32 outputSize,
u32 & encodeSize )
static

pOutput が溜まるまでデコードする

Parameters
handle[in] ハンドル
pStreamReader[in] 読み込みストリーム
pOutput[out] デコード先のバッファの先頭ポインタ
outputSize[in] pOutput のサイズを指定 (chunkSizeByte を超えないよう注意)
encodeSize[in,out] 現在のファイル位置を指定
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deleteDecoderHandle()

b32 GxZlib::deleteDecoderHandle ( void * handle)
static

ハンドルを削除する

Parameters
handle[in] 削除するハンドル
Returns
成功ならtrue
Here is the caller graph for this function:

◆ encode() [1/2]

GxZlib::RESULT GxZlib::encode ( GxStreamWriter & writer,
GxMemoryStream * pInput,
u32 level = ENCODE_LEVEL_DEFAULT )

圧縮 (圧縮元メモリストリーム指定)

Parameters
writer[out] 圧縮先出力ストリームライタ
pInput[in] 圧縮元入力メモリストリーム
level[in] 圧縮レベル (省略可)
Returns
処理結果 (GxZlib::RESULT定義参照)
Here is the call graph for this function:

◆ encode() [2/2]

GxZlib::RESULT GxZlib::encode ( GxStreamWriter & writer,
void * pInput,
u32 inputSize,
u32 level = ENCODE_LEVEL_DEFAULT )

圧縮

Parameters
writer[out] 圧縮先出力ストリームライタ
pInput[in] 圧縮元入力バッファポインタ
inputSize[in] 圧縮元入力バッファサイズ
level[in] 圧縮レベル (省略可)
Returns
処理結果 (GxZlib::RESULT定義参照)
Note
キャンセル非対応
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEncodeHeader() [1/2]

b32 GxZlib::getEncodeHeader ( GxEncodeHeader & dst,
const GxStreamReader & reader )
static

圧縮データヘッダー取得 (ストリームリーダ指定)

Parameters
dst[out] 圧縮データヘッダー格納先
reader[in] 圧縮データヘッダー取得元ストリーム
Returns
成功ならtrue
Note
取得元ストリームは読み込みの都合上内部で const_cast を実行していますが、
Here is the call graph for this function:

◆ getEncodeHeader() [2/2]

b32 GxZlib::getEncodeHeader ( GxEncodeHeader & dst,
const void * pSrc )
static

圧縮データヘッダー取得 (ポインタ指定)

Parameters
dst[out] 圧縮データヘッダー格納先
pSrc[in] 圧縮データヘッダー格納元
Returns
成功ならtrue
Note
取得元ストリームは読み込みの都合上内部で const_cast を実行していますが、
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readHeader()

b32 GxZlib::readHeader ( GxEncodeHeader & dst,
GxStreamReader * pStreamReader )
static

マニュアル操作用(内部使用のみ)

マニュアル操作用(内部使用のみ) pStreamReader からヘッダを読み込む(ファイル位置は戻さない)

Parameters
dst[out] 圧縮データヘッダー格納先
pStreamReader[in] 圧縮データヘッダー取得元ストリーム
Returns
成功ならtrue
Here is the call graph for this function:
Here is the caller graph for this function:

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