GW2RegisterInputFile
Ang GW2RegisterInputFile function ay nagrerehistro ng path sa file na ipo-process sa isang session.
- C++
- C#
- Java
- Python
- JavaScript
Buod
Ang GW2RegisterInputFile function ay nagrerehistro ng file na ipo-process sa session na session. Ang file name ay ang string na itinuturo ng inputFilePath.
#include "glasswall.core2.api.h"
int GW2RegisterInputFile(Session session, const char *inputFilePath);
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Halimbawa
#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 */
Buod
public int RegisterInputFile(
int session,
string inputFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
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
Tandaan
Ang mga parameter ng function na GW2RegisterInputFile ay na-update upang gumamit ng String kapalit ng byte[]. Ang orihinal na function ay deprecated na.
Ibinabalik
Ang function na GW2RegisterInputFile ay nagbabalik ng isang GW2_RetStatus enumeration na kino-convert sa int. Magiging negatibo ang value kung may naganap na error. Ang 0 ay nagpapahiwatig ng tagumpay. Sumangguni sa API Overview/Return types para sa mga detalye.
Isang NullPointerException exception ang ita-throw kung ang inputFilePath ay null o walang laman.
Isang GlasswallException exception ang ita-throw kung hindi wasto ang session, kung hindi makuha ang inputFilePath, o kung hindi ma-convert sa UTF-8 ang inputFilePath.
Buod
Magrehistro ng isang input file o bytes para sa ibinigay na session.
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'.
"""
Ibinabalik
Isang object na may iba't ibang attribute depende sa uri ng input_file.
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may mga attribute na 'session', 'input_file', 'status'.
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may mga attribute na 'session', 'buffer', 'buffer_length', 'status'.
Ang status attribute ay isang integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng failure.
Buod
Inirerehistro ng function na ito ang isang tinukoy na file bilang input file para sa isang tinukoy na session
/**
*
* @param {number} session The ID of the session.
* @param {string} inputFilePath The path of the file to be registered
*/
GW2RegisterInputFile(session, inputFilePath)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.