GW2RegisterImportMemory
GW2RegisterImportMemory 함수는 가져오기에 필요한 교환 파일이 들어 있는 메모리 위치를 등록합니다. 교환 파일은 내보내기 프로세스에서 생성된 zip 파일이며, 메모리 위치는 GW2RegisterExportMemory에서 제공됩니다. GW2RegisterImportMemory 함수를 사용하면 해당 session에 대해 Import Process Mode가 활성화됩니다.
- C++
- C#
- Java
- Python
- JavaScript
#include "glasswall.core2.api.h"
int GW2RegisterImportMemory(Session session, char *importFileBuffer, size_t *importLength);
매개변수
session GW2OpenSession에서 반환된 session의 ID입니다.
importFileBuffer 가져오기에 필요한 교환 파일이 들어 있는 메모리 위치입니다. 메모리 위치는 GW2RegisterExportMemory에서 제공되며, 파일은 교환 파일 형식을 준수해야 합니다.
importLength importFileBuffer의 길이(바이트 단위)
반환값
함수 호출이 성공했는지를 나타내는 정수를 반환합니다. 음수는 실패를 나타냅니다. 반환 코드에 대한 설명은 Return Types 표를 참조하세요.
개요
public int RegisterImportMemory(
int session,
byte[] importFileBuffer)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterImportMemory(int session, byte[] importBuffer) throws GlasswallException, NullPointerException
public int GW2RegisterImportMemory(int session, byte[] importBuffer, int length) throws GlasswallException, NullPointerException
참고
format에 유효한 열거자에 대해서는 API Overview/Return types를 참조하십시오.
The length of the fileBuffer may optionally be specified.
반환값
GW2RegisterImportMemory 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하세요.
GlasswallException 예외는 session이(가) 유효하지 않거나 import buffer를 가져올 수 없는 경우 발생합니다.
NullPointerException 예외는 importBuffer 버퍼가 null이거나 비어 있는 경우 발생합니다.
개요
지정된 session에 대해 가져올 .zip 파일을 등록합니다. 생성된 파일은 session의 run_session 호출 중에 생성됩니다.
def register_import(self, session: int, input_file: Union[str, bytes, bytearray, io.BytesIO]):
""" Registers a .zip file to be imported for the given session. The constructed file will be created during the session's run_session call.
Args:
session (int): The session integer.
input_file (Union[str, bytes, bytearray, io.BytesIO]): The input import file path or bytes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call. 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' 속성이 있는 GwReturnObj 인스턴스입니다. output_file이 None(메모리 모드)인 경우 파일 내용과 파일 크기를 포함하는 'buffer' 및 'buffer_length'도 포함됩니다.
status 속성은 정수 GW2_RetStatus enum 값입니다. 음수는 실패를 나타냅니다.
개요
이 함수는 지정된 session에 대해 import memory location을 등록합니다.
/**
* @param {number} session The ID of the session.
* @param {string} importFileBuffer A pointer to the specified memory location.
* @param {number} importLength The size of the file buffer.
*/
GW2RegisterImportMemory(session, import_File_Buffer, import_File_Buffer_Length)
반환값
status 속성은 정수 GW2_RetStatus enum 값입니다. 음수는 실패를 나타냅니다.