GW2RegisterInputMemory
GW2RegisterInputMemory 関数は、メモリに格納されている入力ファイルをセッションに登録します。
- C++
- C#
- Java
- Python
- JavaScript
概要
GW2RegisterInputMemory 関数は、inputFileBuffer が指すバッファに格納された、サイズ inputLength バイトのファイルを、session. で示されるセッションに登録します。
#include "glasswall.core2.api.h"
int GW2RegisterInputMemory(Session session, const char *inputFileBuffer, size_t inputLength);
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
例
#include "glasswall.core2.api.h"
...
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
/* ... load file contents into buffer 'buf' and log the file size in 'size' ... */
if (GW2RegisterInputMemory(session, buf, size))
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session))
/* error closing session */
概要
public int RegisterInputMemory(
int session,
byte[] inputFileBuffer)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。
概要
import com.glasswall.core2javabridge.*;
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer) throws GlasswallException, NullPointerException
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer, int length) throws GlasswallException, NullPointerException
注
The length of the inputFileBuffer may optionally be specified.
戻り値
GW2RegisterInputMemory 関数は、GW2_RetStatus 列挙型を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については、API Overview/Return types を参照してください。
GlasswallException 例外は、session が無効である場合、または入力バッファーを取得できなかった場合にスローされます。
NullPointerException 例外は、inputFileBuffer バッファーが null または空の場合にスローされます。
概要
指定されたセッションに対して入力ファイルまたはバイト列を登録します。
def register_input(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
""" Register an input file or bytes for the given session.
Args:
session (int): The session integer.
input_file (Union[str, bytes, bytearray, io.BytesIO]): The input file path or bytes.
Returns:
- result (glasswall.GwReturnObj): Depending on the input 'input_file':
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'input_file', 'status'.
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'buffer', 'buffer_length', 'status'.
"""
戻り値
input_file の種類に応じて異なる属性を持つオブジェクト。
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): 属性 'session'、'input_file'、'status' を持つ GwReturnObj インスタンス。
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): 'session'、'buffer'、'buffer_length'、'status' の属性を持つ GwReturnObj インスタンス。
status 属性は整数の GW2_RetStatus enum 値です。負の数は失敗を示します。
概要
この関数は、メモリに保存されたファイルを、指定されたセッションの入力ファイルとして登録します
/**
* @param {number} session The ID of the session.
* @param {string} inputFileBuffer A buffer holding the file data
* @param {number} inputLength The size of the file buffer
*/
GW2RegisterInputMemory(session, inputFileBuffer, inputLength)
戻り値
整数の GW2_RetStatus 列挙値を返します。負の数は失敗を示します。