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

A module which performs installation to the local storage by HTTP. More...

Inherits CriDisposable.

Classes

struct  ModuleConfig
 Module configuration More...
 
struct  StatusInfo
 Status information More...
 

Public Types

enum  Status : int { Stop, Busy, Complete, Error }
 Status More...
 
enum  Error : int {
  None, Timeout, Memory, LocalFs,
  DNS, Connection, SSL, HTTP,
  Internal
}
 Error type More...
 

Public Member Functions

override void Dispose ()
 Discards the installer. More...
 
void Copy (string url, string dstPath)
 Installs the file. More...
 
void Stop ()
 Stops the installation process. More...
 
StatusInfo GetStatusInfo ()
 Gets the status information. More...
 
bool GetCRC32 (out uint ret_val)
 Acquire the CRC32 calculation result More...
 

Static Public Member Functions

static void InitializeModule (ModuleConfig config)
 Initializes the CriFsWebInstaller module More...
 
static void FinalizeModule ()
 Terminates the CriFsWebInstaller module More...
 
static void ExecuteMain ()
 Runs the server process More...
 
static bool SetRequestHeader (string field, string value)
 Changes the information in the HTTP request header. More...
 

Public Attributes

const int InvalidHttpStatusCode = -1
 Invalid HTTP status code More...
 
const long InvalidContentsSize = -1
 Invalid content size More...
 

Properties

static ModuleConfig defaultModuleConfig [get]
 Default module configuration More...
 

Detailed Description

A module which performs installation to the local storage by HTTP.

Description:
Used to install content on the Web server to the local storage.
Note:
On iOS, this function works on iOS7 or later.
Note:
Before creating an instance of CriWare.CriFsWebInstaller, the module must be initialized by calling the CriWare.CriFsWebInstaller::InitializeModule method.

Member Enumeration Documentation

enum Status : int
strong

Status

See also
CriFsWebInstaller::GetStatusInfo
Enumerator
Stop 

Stopped

Busy 

Processing in progress

Complete 

Completed

Error 

Error

enum Error : int
strong

Error type

Description:
Indicates the error type of the installer handle.
Information can be obtained using the CriWare.CriFsWebInstaller::GetStatusInfo function.
See also
CriFsWebInstaller::GetStatusInfo
Enumerator
None 

No error

Timeout 

Timeout error

Memory 

Memory allocation failed

LocalFs 

Local file system error

DNS 

DNS error

Connection 

Connection error

SSL 

SSL error

HTTP 

HTTP error

Internal 

Internal error

Member Function Documentation

override void Dispose ( )
inline

Discards the installer.

Note:
If you discard the installer during the installation process, the process may be blocked in this function for a long time.
void Copy ( string  url,
string  dstPath 
)
inline

Installs the file.

Parameters
urlInstallation source URL
dstPathInstallation destination file path name
Description:
Starts installing files.
This function returns immediately.
To get the copy completion status, use the CriWare.CriFsWebInstaller::GetStatusInfo function.
Note:
- If the installation destination file exists, error CriFsWebInstaller.Error.LocalFs occurs.
See also
CriFsWebInstaller::GetStatusInfo
void Stop ( )
inline

Stops the installation process.

Description:
Stops the processing.
This function returns immediately.
Use the CriWare.CriFsWebInstaller::GetStatusInfo function to get the stop completion status.
See also
CriFsInstaller::GetStatus
StatusInfo GetStatusInfo ( )
inline

Gets the status information.

Returns
Status information
See also
CriFsWebInstaller::StatusInfo
bool GetCRC32 ( out uint  ret_val)
inline

Acquire the CRC32 calculation result

Parameters
ret_valFor CRC result storage
Description:
Returns a checksum that is valid only in the Status.Complete state.
If it is acquired in a state other than Status.Complete, the CRC result will be 0.
This function can be used only when ModuleConfig.crcEnabled=true .
See also
CriFsWebInstaller::StatusInfo
static void InitializeModule ( ModuleConfig  config)
inlinestatic

Initializes the CriFsWebInstaller module

Parameters
configConfiguration
Description:
Initializes the CriFsWebInstaller module.
In order to use the function of the module, you must call this function.
(You can use the features of the module after calling this function and before calling the CriWare.CriFsWebInstaller::FinalizeModule function.)
Note:
After calling this function, be sure to call the corresponding CriWare.CriFsWebInstaller::FinalizeModule function.
In addition, this function cannot be called again until the CriWare.CriFsWebInstaller::FinalizeModule function is called.
See also
CriFsWebInstaller::ModuleConfig, CriFsWebInstaller::FinalizeModule
static void FinalizeModule ( )
inlinestatic

Terminates the CriFsWebInstaller module

Description:
Terminates the CriFsWebInstaller module.
Note:
- This function cannot be called before calling the CriWare.FsWebInstaller::InitializeModule function.
  • All CriWare.FsWebInstaller must be discarded.
See also
CriFsWebInstaller::InitializeModule
static void ExecuteMain ( )
inlinestatic

Runs the server process

Description:
Executes the server processing. It should be run regularly.
static bool SetRequestHeader ( string  field,
string  value 
)
inlinestatic

Changes the information in the HTTP request header.

Parameters
fieldField name
valueField value
Description:
Changes the information in the HTTP request header.
This function must be called after calling the CriWare.CriFsWebInstaller::InitializeModule function.
Call this function before invoking the installation.
If the field name is already registered, the field value will be overwritten.
If null is passed as the field value, the field is removed.

Member Data Documentation

const int InvalidHttpStatusCode = -1

Invalid HTTP status code

Description:
A constant that represents an invalid HTTP status code.
It is set when the installation fails due to a reason other than HTTP.
This value is guaranteed to be negative.
See also
CriFsWebInstaller::StatusInfo.httpStatusCode
const long InvalidContentsSize = -1

Invalid content size

Description:
It is set when the size of the installation target cannot be acquired.
This value is guaranteed to be negative.
See also
CriFsWebInstaller::StatusInfo.contentsSize

Property Documentation

ModuleConfig defaultModuleConfig
staticget

Default module configuration

Description:
Default module config.
Note:
Change the default configuration obtained using this property and specify it in the CriWare.CriFsWebInstaller::InitializeModule function.
See also
CriFsWebInstaller::InitializeModule

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