GW2RegisterExportMemory
GW2RegisterExportMemory 함수는 내보낸 파일을 저장할 메모리 위치를 등록합니다. 이 함수를 사용하면 세션에 대해 Export Process Mode가 활성화됩니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
세션 session에 대해 GW2RegisterExportMemory 함수는 내보낸 콘텐츠가 배치될 위치와 내보낸 콘텐츠의 바이트 단위 크기가 배치될 위치를 등록합니다. 내보낸 콘텐츠에 대한 포인터는 exportFileBuffer가 가리키는 객체에 배치되며, 내보낸 데이터의 바이트 단위 크기는 exportFileBufferLength가 가리키는 size_t 객체에 배치됩니다. 내보낸 콘텐츠는 GW2CloseSession을 사용해 세션이 닫힐 때 삭제됩니다. 이 함수를 사용하면 세션에 대해 Export Process Mode가 활성화됩니다.
#include "glasswall.core2.api.h"
int GW2RegisterExportMemory(Session session,
char **exportFileBuffer,
size_t *exportFileBufferLength);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
public int RegisterExportMemory(
int session,
out IntPtr exportFileBufferPtr,
ref UIntPtr exportBufferLengthPtr)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportMemory(int session) throws GlasswallException
설명
GW2RegisterExportMemory 함수는 session으로 지정된 세션에 대해, 내보낸 파일의 출력으로 사용할 메모리 버퍼를 등록합니다. 내보낸 데이터를 가져오려면 GW2RunSession을 호출한 후 GetExportBuffer를 호출하십시오.
반환값
GW2RegisterExportMemory 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API 개요/반환 형식을 참조하십시오.
GlasswallException 예외는 session이 유효하지 않으면 발생합니다.
개요 - 데이터 검색
import com.glasswall.core2javabridge.*;
public byte[] GetExportBuffer(int session) throws GlasswallException
설명
GetExportBuffer 함수는 session으로 지정된 세션과 연결된 내보내기 버퍼의 내용을 가져옵니다.
반환값
GetExportBuffer 함수는 내보낸 파일이 포함된 byte[]를 반환합니다. GW2RegisterExportMemory 및 GW2RunSession이 호출되지 않았거나 파일이 규격에 맞지 않는 경우 null이 반환됩니다.
GlasswallException 예외는 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' 속성을 가진 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 enum 값을 반환합니다. 음수는 실패를 나타냅니다.