GW2FileSessionStatus
GW2FileSessionStatus 関数は、指定されたセッション内で最後に処理されたファイルに対して実行された処理を高レベルで説明する文字列を提供します。
- C++
- C#
- Java
- Python
- JavaScript
#include "glasswall.core2.api.h"
int GW2FileSessionStatus(
Session session,
int *glasswallSessionStatus,
char **statusMsgBuffer,
size_t *statusBufferLength);
パラメーター
session GW2OpenSession によって返されるセッションの ID
glasswallSessionStatus An integer output parameter describing the return status of the session as it relates to the last file that was processed. See the Return Types table for an explanation of glasswallSessionStatus.
statusMsgBuffer セッションで最後に処理されたファイルに対して実行された処理の概要説明が格納される、文字列ポインターの出力パラメーターです。例: "Sanitisation Applied, Remedies Applied"。このポインターで使用されるメモリは、ユーザーが解放する必要はありません。
statusBufferLength statusMsgBuffer が指すメモリのサイズをバイト単位で格納する出力パラメーターです。
戻り値
関数呼び出しが成功したかどうかを示す整数を返します。負の数は失敗を示します。戻りコードの説明については、Return Types 表を参照してください。session が無効な場合、glasswallSessionStatus、statusMsgBuffer、および statusBufferLength は未定義になります。
概要
/// <param name="session">Current open Glasswall session</param>
/// <param name="gwSessionStatus">Session status value</param>
/// <param name="outputBuffer">String that describes, at a high level, the processing carried out on the last document </param>
/// <param name="bufferLength">Size of the outputBuffer</param>
public int FileSessionStatus(
int session,
out IntPtr gwSessionStatus,
out IntPtr outputBuffer,
ref UIntPtr bufferLength)
戻り値
session が無効な場合は、-1 を返します。session が有効な場合、関数は 0 を返し、gwSessionStatus、outputBuffer、および bufferLength が設定されます。
概要
import com.glasswall.core2javabridge.*;
public FileSessionStatus GW2FileSessionStatusResult(int session) throws GlasswallException
注
この機能では以前、ID データを取得するために 3 つの個別の関数呼び出しが必要でした。現在は合理化され、設定を FileSessionStatus オブジェクトとして返すようになっています。元の 3 つの関数は非推奨になりました。
戻り値
The GW2FileSessionStatusResult function returns a FileSessionStatus object containing the session summary status, and the session summary description.
FileSessionStatus オブジェクトには、関数呼び出し時点の session のステータスを説明する 2 つの変数が含まれています。以下のとおりです。
| 変数 | 説明 |
|---|---|
int summaryStatus | 実行された全体的な処理を示すステータス |
String summaryDescription | 実行された全体的な処理の説明 |
GlasswallException 例外は、session が無効である場合、またはセッションステータス情報を取得できなかった場合にスローされます。
概要 - 非推奨関数
import com.glasswall.core2javabridge.*;
(Deprecated)
public int GW2FileSessionStatus(int session) throws GlasswallException
public int GetFileSessionStatusInt(int session) throws GlasswallException
public byte[] GetStatusBuffer(int session) throws GlasswallException
説明
GW2FileSessionStatus 関数は、session で指定されたセッションについてセッションステータス情報を取得できたかどうかを示すステータスを返します。
GetFileSessionStatusInt 関数を使用して、セッションの要約ステータスを取得します。
GetStatusBuffer 関数を使用して、セッションの要約ステータスデータを取得します。
戻り値 - 非推奨関数
GW2FileSessionStatus 関数は、GW2_RetStatus 列挙型を int に変換して返します。エラーが発生した場合、値は負になります。0 は成功を示します。詳細については API Overview/Return types を参照してください。
GetStatusBuffer 関数は、指定されたセッションに関する要約説明を含むバイト配列バッファを返します。GW2FileSessionStatus が呼び出されていない場合、これは null になります。
GetFileSessionStatusInt 関数は、実行された全体的な処理を示すステータスを返します。
GlasswallException 例外は、session が無効である場合、または session のステータス情報を取得できなかった場合にスローされます。
概要
Glasswall セッションステータスメッセージを取得します。実行された処理の概要を高レベルで示します。
def file_session_status_message(self, session: int, raise_unsupported: bool = True) -> str:
""" Retrieves the Glasswall session status message. Gives a high level indication of the processing that was carried out.
Args:
session (int): The session integer.
raise_unsupported (bool, optional): Default True. Raise exceptions when Glasswall encounters an error. Fail silently if False.
Returns:
result.message (str):The file session status message.
"""
戻り値
文字列としてのファイルセッションステータスメッセージ。
概要
/**
* This function retrieves the Glasswall Session Status. This status gives a high level indication of the processing
* that was carried out on the last document processed by the library
*/
GW2FileSessionStatus(session,
glasswallSessionStatus,
statusMsgBuffer,
statusBufferLength)
戻り値
session が無効な場合は、-1 が返され、glasswallSessionStatus、statusMsgBuffer、statusBufferLength は未定義になります。session が有効な場合、関数は 0 を返し、glasswallSessionStatus、statusMsgBuffer、statusBufferLength には値が設定されます。
例
function getFileSessionStatus(session_id, gw) {
/*
Glasswall API signature:
int GW2FileSessionStatus(
Session session,
int *glasswallSessionStatus,
char **statusMsgBuffer,
size_t *statusBufferLength
);
*/
// allocate space to store the session status; use .deref() to extract it
let glasswallSessionStatus = ref.alloc('int');
let CString_ptr = ref.refType(ref.types.CString);
let statusMsgBuffer = ref.alloc(CString_ptr);
// allocate space to store the buffer length; use .deref() to extract it
let statusBufferLength = ref.alloc('size_t');
let rv = gw.GW2FileSessionStatus(session_id, glasswallSessionStatus, statusMsgBuffer, statusBufferLength);
arr_buf = buffer_to_array(statusMsgBuffer, statusBufferLength)
// console.log(arr_buf.toString());
let message = `\n GW2FileSessionStatus:return=${rv}`;
message += "\n glasswallSessionStatus = " + glasswallSessionStatus.deref();
message += "\n statusMsgBuffer = \"" + arr_buf.toString() + '"';
message += "\n statusBufferLength = " + statusBufferLength.deref();
return message;
}