GW2RegisterExportMemory
GW2RegisterExportMemory 関数は、エクスポートされたファイルを保存するメモリ位置を登録します。この関数を使用すると、その session の Export Process Mode が 有効化 されます。
- C++
- C#
- Java
- Python
- JavaScript
概要
session session に対して、GW2RegisterExportMemory 関数は、エクスポートされたコンテンツの配置先と、そのエクスポートされたコンテンツのバイト単位のサイズの配置先を登録します。エクスポートされたコンテンツへのポインターは exportFileBuffer が指すオブジェクトに格納され、エクスポートされたデータのバイト単位のサイズは exportFileBufferLength が指す size_t オブジェクトに格納されます。エクスポートされたコンテンツは、GW2CloseSession を使用して session が閉じられると削除されます。この関数を使用すると、その session の Export Process Mode が有効化されます。
#include "glasswall.core2.api.h"
int GW2RegisterExportMemory(Session session,
char **exportFileBuffer,
size_t *exportFileBufferLength);
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
public int RegisterExportMemory(
int session,
out IntPtr exportFileBufferPtr,
ref UIntPtr exportBufferLengthPtr)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportMemory(int session) throws GlasswallException
説明
GW2RegisterExportMemory 関数は、session で指定されたセッションについて、エクスポートされたファイルの出力先として使用するメモリバッファを登録します。エクスポートされたデータを取得するには、GW2RunSession を呼び出した後に GetExportBuffer を呼び出してください。
戻り値
GW2RegisterExportMemory 関数は、GW2_RetStatus 列挙型を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については、API Overview/Return types を参照してください。
GlasswallException 例外は、session が無効な場合にスローされます。
概要 - データの取得
import com.glasswall.core2javabridge.*;
public byte[] GetExportBuffer(int session) throws GlasswallException
説明
GetExportBuffer 関数は、session で指定されたセッションに関連付けられたエクスポートバッファの内容を取得します。
戻り値
GetExportBuffer 関数は、エクスポートされたファイルを含む byte[] を返します。GW2RegisterExportMemory と GW2RunSession が呼び出されていない場合、またはファイルが非準拠である場合、これは null になります。
GlasswallException 例外は、session が無効な場合にスローされます。
概要
指定された session に対して、エクスポートするファイルを登録します。エクスポートファイルは、その session の run_session 呼び出し中に作成されます。
def register_export(self, session: int, output_file: Optional[str] = None):
""" Registers a file to be exported for the given session. The export file will be created during the session's run_session call.
Args:
session (int): The session integer.
output_file (Optional[str]): Default None. The file path where the export will be written. None exports the file in memory.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call and 'session', the session integer. 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' が関数呼び出しの結果を示し、'session' が session の整数値を示す GwReturnObj インスタンスです。output_file が None(メモリモード)の場合、ファイル内容とファイルサイズを含む 'buffer' および 'buffer_length' も含まれます。
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。
概要
この関数は、指定されたセッションに対してエクスポート用メモリ位置を登録します。
/**
*
* @param {number} session The ID of the session.
* @param {string} exportFileBuffer A pointer to the specified memory location.
* @param {number} exportLength The size of the file buffer.
*/
GW2RegisterExportMemory(session, exportFileBuffer, exportLength)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。