CRIWARE Unity Plugin Manual  Last Updated: 2024-07-12
CriFsLoader Class Reference

A module for loading files into memory. More...

Inherits CriDisposable.

Public Types

enum  Status { Stop, Loading, Complete, Error }
 A value indicating the loader status. More...
 

Public Member Functions

override void Dispose ()
 Discards the loader. More...
 
void Load (CriFsBinder binder, string path, long fileOffset, long loadSize, byte[] buffer)
 Starts loading data. More...
 
void LoadById (CriFsBinder binder, int id, long fileOffset, long loadSize, byte[] buffer)
 Starts loading data. More...
 
void LoadWithoutDecompression (CriFsBinder binder, string path, long fileOffset, long loadSize, byte[] buffer)
 Loads the compressed data into memory without expanding it. More...
 
void LoadWithoutDecompressionById (CriFsBinder binder, int id, long fileOffset, long loadSize, byte[] buffer)
 Loads the compressed data into memory without expanding it. More...
 
void DecompressData (long srcSize, byte[] srcBuffer, long dstSize, byte[] dstBuffer)
 Starts decompressing the compressed data place on the memory. More...
 
void Stop ()
 Stops the loading process. More...
 
Status GetStatus ()
 Gets the loader status. More...
 
void SetReadUnitSize (int unit_size)
 Sets the unit read size More...
 

Detailed Description

A module for loading files into memory.

Description:
A module for loading files into memory.
By combining with CriWare.CriFsBinder , the content in the CPK file can also be read.
See also
CriFsBinder

Member Enumeration Documentation

enum Status
strong

A value indicating the loader status.

See also
CriFsLoader::GetStatus
Enumerator
Stop 

Stopped

Loading 

Loading

Complete 

Loading complete

Error 

Error occurred

Member Function Documentation

override void Dispose ( )
inline

Discards the loader.

Note:
If you discard the loader during the loading process, the process may be blocked in this function for a long time.
void Load ( CriFsBinder  binder,
string  path,
long  fileOffset,
long  loadSize,
byte[]  buffer 
)
inline

Starts loading data.

Parameters
binderBinder
pathFile path name
fileOffsetOffset from the beginning of the file (in bytes)
loadSizeLoad request size (in bytes)
bufferLoad destination buffer
Description:
Starts reading data with the specified binder and file name.
Read loadSize bytes from offset fileOffset in the file.
This function returns immediately.
To get the load completion status, use the CriWare.CriFsLoader::GetStatus function.
See also
CriFsLoader::GetStatus
void LoadById ( CriFsBinder  binder,
int  id,
long  fileOffset,
long  loadSize,
byte[]  buffer 
)
inline

Starts loading data.

Parameters
binderBinder
idFile ID
fileOffsetOffset from the beginning of the file (in bytes)
loadSizeLoad request size (in bytes)
bufferLoad destination buffer
Description:
Starts reading data with the specified binder and file ID.
Read loadSize bytes from offset fileOffset in the file.
This function returns immediately.
To get the load completion status, use the CriWare.CriFsLoader::GetStatus function.
See also
CriFsLoader::GetStatus
void LoadWithoutDecompression ( CriFsBinder  binder,
string  path,
long  fileOffset,
long  loadSize,
byte[]  buffer 
)
inline

Loads the compressed data into memory without expanding it.

Parameters
binderBinder
pathFile path name
fileOffsetOffset from the beginning of the file (in bytes)
loadSizeLoad request size (in bytes)
bufferLoad destination buffer
Description:
Starts reading data with the specified binder and file name.
Read loadSize bytes from offset fileOffset in the file.
Unlike the CriWare.CriFsLoader::Load function, even if the data is compressed, it will load the data in memory without expanding it.
This function returns immediately.
To get the load completion status, use the CriWare.CriFsLoader::GetStatus function.
See also
CriFsLoader::GetStatus, CriFsLoader::LoadWithoutDecompressionById, CriFsLoader::DecompressData
void LoadWithoutDecompressionById ( CriFsBinder  binder,
int  id,
long  fileOffset,
long  loadSize,
byte[]  buffer 
)
inline

Loads the compressed data into memory without expanding it.

Parameters
binderBinder
idFile ID
fileOffsetOffset from the beginning of the file (in bytes)
loadSizeLoad request size (in bytes)
bufferLoad destination buffer
Description:
Starts reading data with the specified binder and file ID.
Read loadSize bytes from offset fileOffset in the file.
Unlike the CriWare.CriFsLoader::Load function, even if the data is compressed, it will load the data in memory without expanding it.
This function returns immediately.
To get the load completion status, use the CriWare.CriFsLoader::GetStatus function.
See also
CriFsLoader::GetStatus, CriFsLoader::LoadWithoutDecompression, CriFsLoader::DecompressData
void DecompressData ( long  srcSize,
byte[]  srcBuffer,
long  dstSize,
byte[]  dstBuffer 
)
inline

Starts decompressing the compressed data place on the memory.

Parameters
srcSizeCompressed data size (in bytes)
srcBufferThe buffer containing the compressed data
dstSizeSize of the expansion destination buffer (in bytes)
dstBufferExpansion destination buffer
Description:
Expands the compressed data placed on the memory to another memory area.
This function returns immediately.
To get the load completion status, use the criFsLoader_GetStatus function.
Note:
If the input data is not compressed, this function copies the input data to the output address as is.
Note:
This function supports only CRI proprietary software compression codec.
This function cannot be used to expand the data when using a hardware decoder or when using a platform-specific codec.
See also
CriFsLoader::GetStatus, CriFsLoader::LoadWithoutDecompression, CriFsLoader::LoadWithoutDecompressionById
void Stop ( )
inline

Stops the loading process.

Description:
Stops the loading process.

This function returns immediately.
To get the stopping status, use the CriWare.CriFsLoader::GetStatus function.
Note:
Even if this function is called, data transfer to the buffer may continue until the loader status CriWare.CriFsLoader::Status changes to Stop.
See also
CriFsLoader::GetStatus
Status GetStatus ( )
inline

Gets the loader status.

Returns
Status
Description:
Gets the loader status.
See also
CriFsLoader::Status
void SetReadUnitSize ( int  unit_size)
inline

Sets the unit read size

Parameters
unit_sizeUnit read size
Description:
Sets the read unit size. When processing a read request with large size, CriFsLoader divides it into multiple reads with smaller size and repeats the reads.
It is possible to change the read unit size by using this function.
Cancellation of read request or interrupt of high priority read processing, etc. are processed only at the unit read size boundary.
Therefore, setting a smaller unit size improves the response of I/O processing.
Conversely, if you set a large unit size, the speed of reading files improves.
See also
CriFsLoader::Status

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