GW2RegisterImportMemory
GW2RegisterImportMemory function import के लिए आवश्यक interchange file को containing memory location को register करती है। interchange file export process से उत्पन्न zip file है और memory location GW2RegisterExportMemory द्वारा प्रदान की जाती है। GW2RegisterImportMemory function का उपयोग session के लिए Import Process Mode को activate करता है।
- C++
- C#
- Java
- Python
- JavaScript
#include "glasswall.core2.api.h"
int GW2RegisterImportMemory(Session session, char *importFileBuffer, size_t *importLength);
पैरामीटर
session GW2OpenSession द्वारा लौटाई गई session की ID।
importFileBuffer import के लिए आवश्यक interchange file को containing memory location। memory location GW2RegisterExportMemory द्वारा प्रदान की जाती है और file को interchange file format के अनुरूप होना चाहिए।
importLength importFileBuffer की लंबाई बाइट्स में
रिटर्न
एक integer लौटाता है जो बताता है कि function call सफल रहा या नहीं। Negative numbers विफलता को दर्शाते हैं। return codes की व्याख्या के लिए 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 के लिए मान्य enumerators हेतु API Overview/Return types देखें।
The length of the fileBuffer may optionally be specified.
रिटर्न
GW2RegisterImportMemory फ़ंक्शन GW2_RetStatus enumeration को int में परिवर्तित करके लौटाता है। यदि कोई त्रुटि हुई है, तो मान नकारात्मक होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
A GlasswallException exception will be thrown if session is invalid, or if the import buffer could not be retrieved.
A NullPointerException exception will be thrown if importBuffer buffer is null or empty.
सारांश
दिए गए session के लिए import की जाने वाली .zip file को register करता है। निर्मित file session के run_session call के दौरान बनाई जाएगी।
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' attribute के साथ एक GwReturnObj instance, जो function call के परिणाम को दर्शाता है। यदि output_file None है (memory mode), तो file content और file size को शामिल करते हुए 'buffer' और 'buffer_length' शामिल किए जाते हैं।
status attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।
सारांश
यह function किसी निर्दिष्ट session के लिए एक import memory location register करता है।
/**
* @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 attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।