GW2RegisterImportMemory
GW2RegisterImportMemory 関数は、インポートに必要な交換ファイルを含むメモリ位置を登録します。交換ファイルはエクスポート処理で生成される zip ファイルであり、そのメモリ位置は GW2RegisterExportMemory によって提供されます。GW2RegisterImportMemory 関数を使用すると、そのセッションのインポート処理モードが 有効化 されます。
- C++
- C#
- Java
- Python
- JavaScript
#include "glasswall.core2.api.h"
int GW2RegisterImportMemory(Session session, char *importFileBuffer, size_t *importLength);
パラメーター
session GW2OpenSession によって返されるセッションの ID。
importFileBuffer インポートに必要な交換ファイルを含むメモリ位置。このメモリ位置は GW2RegisterExportMemory によって提供され、ファイルは交換ファイル形式に準拠している必要があります。
importLength importFileBuffer の長さ(バイト単位)
戻り値
関数呼び出しが成功したかどうかを示す整数を返します。負の数は失敗を示します。戻りコードの説明については、Return Types 表を参照してください。
概要
public int RegisterImportMemory(
int session,
byte[] importFileBuffer)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
import com.glasswall.core2javabridge.*;
public int GW2RegisterImportMemory(int session, byte[] importBuffer) throws GlasswallException, NullPointerException
public int GW2RegisterImportMemory(int session, byte[] importBuffer, int length) throws GlasswallException, NullPointerException
注
format の有効な列挙子については、API Overview/Return types を参照してください。
The length of the fileBuffer may optionally be specified.
戻り値
GW2RegisterImportMemory 関数は、GW2_RetStatus 列挙を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については、API Overview/Return types を参照してください。
GlasswallException 例外は、session が無効である場合、またはインポートバッファーを取得できなかった場合にスローされます。
NullPointerException 例外は、importBuffer バッファーが null または空の場合にスローされます。
概要
指定されたセッションに対して、インポート対象の .zip ファイルを登録します。構築されたファイルは、セッションの run_session 呼び出し中に作成されます。
def register_import(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
""" Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.
Args:
session (int): The session integer.
input_file (Union[str, bytes, bytearray, io.BytesIO]): The input import file path or bytes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size.
"""
戻り値
gw_return_object (glasswall.GwReturnObj): 関数呼び出しの結果を示す属性 'status' を持つ GwReturnObj インスタンスです。output_file が None(メモリモード)の場合、ファイル内容とファイルサイズを含む 'buffer' および 'buffer_length' が含まれます。
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。
概要
この関数は、指定されたセッションに対してインポートメモリ位置を登録します。
/**
* @param {number} session The ID of the session.
* @param {string} importFileBuffer A pointer to the specified memory location.
* @param {number} importLength The size of the file buffer.
*/
GW2RegisterImportMemory(session, import_File_Buffer, import_File_Buffer_Length)
戻り値
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。