GW2RegisterInputMemory
GW2RegisterInputMemory फ़ंक्शन मेमोरी में संग्रहीत इनपुट फ़ाइल को एक session के लिए रजिस्टर करता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
GW2RegisterInputMemory फ़ंक्शन inputLength bytes आकार के inputFileBuffer द्वारा इंगित buffer में संग्रहीत फ़ाइल को, session. द्वारा दर्शाए गए session के साथ रजिस्टर करता है।
#include "glasswall.core2.api.h"
int GW2RegisterInputMemory(Session session, const char *inputFileBuffer, size_t inputLength);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
उदाहरण
#include "glasswall.core2.api.h"
...
HANDLE session = GW2OpenSession();
if (!session)
/* deal with error */
else
{
/* ... load file contents into buffer 'buf' and log the file size in 'size' ... */
if (GW2RegisterInputMemory(session, buf, size))
/* deal with error */
else
/* continue processing */
...
}
/* later */
if (GW2CloseSession(session))
/* error closing session */
सारांश
public int RegisterInputMemory(
int session,
byte[] inputFileBuffer)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
import com.glasswall.core2javabridge.*;
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer) throws GlasswallException, NullPointerException
public int GW2RegisterInputMemory(int session, byte[] inputFileBuffer, int length) throws GlasswallException, NullPointerException
नोट
The length of the inputFileBuffer may optionally be specified.
रिटर्न
GW2RegisterInputMemory फ़ंक्शन GW2_RetStatus enumeration को int में परिवर्तित करके लौटाता है। यदि कोई त्रुटि हुई हो, तो मान नकारात्मक होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
A GlasswallException exception will be thrown if session is invalid, or if the input buffer could not be retrieved.
A NullPointerException exception will be thrown if inputFileBuffer buffer is null or empty.
सारांश
दिए गए session के लिए एक input file या bytes register करें।
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 के प्रकार के आधार पर अलग-अलग attributes वाला एक object।
- If input_file is a str file path:
- gw_return_object (glasswall.GwReturnObj): 'session', 'input_file', 'status' attributes के साथ एक GwReturnObj instance।
- If input_file is a file in memory:
- gw_return_object (glasswall.GwReturnObj): 'session', 'buffer', 'buffer_length', 'status' attributes वाला एक GwReturnObj instance।
status attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।
सारांश
यह फ़ंक्शन memory में संग्रहीत किसी फ़ाइल को निर्दिष्ट session के लिए input file के रूप में register करता है
/**
* @param {number} session The ID of the session.
* @param {string} inputFileBuffer A buffer holding the file data
* @param {number} inputLength The size of the file buffer
*/
GW2RegisterInputMemory(session, inputFileBuffer, inputLength)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।