GW2RegisterInputFile
GW2RegisterInputFile 함수는 세션에서 처리할 파일의 경로를 등록합니다.
- C++
- C#
- Java
- Python
- JavaScript
개요
GW2RegisterInputFile 함수는 session 세션에서 처리할 파일을 등록합니다. 파일 이름은 inputFilePath가 가리키는 문자열입니다.
#include "glasswall.core2.api.h"
int GW2RegisterInputFile(Session session, const char *inputFilePath);
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
예제
#include "glasswall.core2.api.h"
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
if (GW2RegisterInputFile(session, "filename.doc") < 0)
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session) < 0)
/* error closing session */
개요
public int RegisterInputFile(
int session,
string inputFilePath)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.
개요
import com.glasswall.core2javabridge.*;
public int GW2RegisterInputFile(int session, String inputFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterInputFile(int session, byte[] inputFilePath) throws GlasswallException, NullPointerException
참고
The GW2RegisterInputFile function parameters have been updated to use String in place of byte[]. The original function has been deprecated.
반환값
GW2RegisterInputFile 함수는 GW2_RetStatus 열거형을 int로 변환하여 반환합니다. 오류가 발생한 경우 값은 음수가 됩니다. 0은 성공을 나타냅니다. 자세한 내용은 API Overview/Return types를 참조하세요.
NullPointerException 예외는 inputFilePath가 null이거나 비어 있는 경우 발생합니다.
GlasswallException 예외는 session이 유효하지 않거나, inputFilePath를 가져올 수 없거나, inputFilePath를 UTF-8로 변환할 수 없는 경우 발생합니다.
개요
지정된 세션에 대해 입력 파일 또는 바이트를 등록합니다.
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} inputFilePath The path of the file to be registered
*/
GW2RegisterInputFile(session, inputFilePath)
반환값
정수 GW2_RetStatus enum 값을 반환합니다. 음수는 실패를 나타냅니다.