GW2RegisterExportTextDumpMemory
GW2RegisterExportTextDumpMemory 함수는 내보내기 텍스트 덤프 파일을 저장할 메모리 위치를 등록합니다. 이 함수를 사용하면 세션의 Export Process Mode에 대해 Text Dump 옵션이 활성화됩니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
세션 session에 대해 GW2RegisterExportTextDumpMemory 함수는 내보낸 콘텐츠의 텍스트 덤프를 배치할 위치와 텍스트 덤프 콘텐츠의 바이트 단위 크기를 배치할 위치를 등록합니다. 텍스트 덤프 콘텐츠에 대한 포인터는 exportTextDumpFileBuffer가 가리키는 객체에 저장되고, 텍스트 덤프 데이터의 바이트 단위 크기는 exportTextDumpLength가 가리키는 size_t 객체에 저장됩니다. 텍스트 덤프 콘텐츠는 GW2CloseSession을 사용해 세션이 닫히면 삭제됩니다. 이 함수를 사용하면 세션의 Export Process Mode에 대해 Text Dump 옵션이 활성화됩니다.
#include "glasswall.core2.api.h"
int GW2RegisterExportTextDumpMemory(Session session,
char **exportTextDumpFileBuffer,
size_t *exportTextDumpLength);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
public int RegisterTextDumpMemory(
int session,
out IntPtr textDumptFileBufferPtr,
ref UIntPtr textDumpBufferLengthPtr)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportTextDumpMemory(int session) throws GlasswallException
설명
GW2RegisterExportTextDumpMemory 함수는 session으로 지정된 세션의 내보낸 텍스트 덤프 출력으로 메모리 버퍼를 등록합니다. 내보낸 텍스트 덤프 데이터를 가져오려면 GW2RunSession을 호출한 후 GetTextDumpBuffer를 호출하십시오.
반환값
GW2RegisterExportTextDumpMemory 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생하면 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하십시오.
GlasswallException 예외는 session이 유효하지 않으면 발생합니다.
개요 - 데이터 검색
import com.glasswall.core2javabridge.*;
public byte[] GetTextDumpBuffer(int session) throws GlasswallException
설명
session으로 지정된 세션과 연결된 내보낸 텍스트 덤프 버퍼의 내용을 가져옵니다.
반환값
내보낸 텍스트 덤프를 포함하는 byte[]를 반환합니다. GW2RegisterExportTextDumpMemory 및 GW2RunSession이 호출되지 않은 경우 이 바이트 배열은 null입니다.
`session```이 유효하지 않으면 GlasswallException 예외가 발생합니다.
개요
지정된 세션에 대해 내보낸 텍스트 덤프의 출력으로 메모리 버퍼를 등록합니다. 텍스트 덤프는 세션의 run_session 호출 중에 생성됩니다.
def _GW2RegisterExportTextDumpMemory(self, session: int):
""" Registers an export text dump to be written in memory.
Args:
session (int): The session integer.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'buffer', 'buffer_length', 'status'.
"""
반환값
gw_return_object (glasswall.GwReturnObj): 'session', 'buffer', 'buffer_length', 'status' 속성을 가진 GwReturnObj 인스턴스입니다.
status 속성은 정수 GW2_RetStatus enum 값입니다. 음수는 실패를 나타냅니다.
텍스트 덤프는 glasswall.utils.buffer_to_bytes를 사용하여 run_session이 호출된 후 바이트로 변환할 수 있습니다.
예제
import glasswall
editor = glasswall.Editor(r"<path to dir containing Glasswall libraries>")
input_file = r"<path to an input file>"
with open(input_file, "rb") as f:
input_file_memory = f.read()
with editor.new_session() as session:
register_input = editor._GW2RegisterInputMemory(session, input_file_memory)
register_export = editor._GW2RegisterExportMemory(session)
register_export_text_dump_memory = editor._GW2RegisterExportTextDumpMemory(session)
status = editor.run_session(session)
file_session_status = editor._GW2FileSessionStatus(session)
file_error_message = editor._GW2FileErrorMsg(session)
file_bytes = glasswall.utils.buffer_to_bytes(
register_export.buffer,
register_export.buffer_length
)
text_dump = glasswall.utils.buffer_to_bytes(
register_export_text_dump_memory.buffer,
register_export_text_dump_memory.buffer_length
)
개요
이 함수는 지정된 세션에 대해 export text dump 메모리 위치를 등록합니다.
/**
*
* @param {number} session The ID of the session.
* @param {string} exportTextDumpFileBuffer A pointer to the specified memory location.
* @param {number} exportTextDumpLength The size of the file buffer.
*/
GW2RegisterExportTextDumpMemory(session, exportTextDumpFileBuffer, exportTextDumpLength)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.