GW2RegisterExportMemory
GW2RegisterExportMemory फ़ंक्शन exported फ़ाइल को संग्रहीत करने के लिए memory location को register करता है। इस फ़ंक्शन का उपयोग session के लिए Export Process Mode को सक्रिय करता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
session session के लिए, GW2RegisterExportMemory फ़ंक्शन यह register करता है कि exported content कहाँ रखा जाना है, और exported content का size in bytes कहाँ रखा जाना है। exported content का pointer exportFileBuffer द्वारा pointed object में रखा जाएगा और exported data का size in bytes exportFileBufferLength द्वारा pointed size_t object में रखा जाएगा। exported content को GW2CloseSession का उपयोग करके session बंद होने पर delete कर दिया जाएगा। इस फ़ंक्शन का उपयोग session के लिए Export Process Mode को सक्रिय करता है।
#include "glasswall.core2.api.h"
int GW2RegisterExportMemory(Session session,
char **exportFileBuffer,
size_t *exportFileBufferLength);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
public int RegisterExportMemory(
int session,
out IntPtr exportFileBufferPtr,
ref UIntPtr exportBufferLengthPtr)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportMemory(int session) throws GlasswallException
विवरण
GW2RegisterExportMemory फ़ंक्शन session द्वारा निर्दिष्ट session के लिए exported file के output के रूप में उपयोग किए जाने हेतु एक memory buffer को register करता है। Exported data प्राप्त करने के लिए GW2RunSession को कॉल करने के बाद GetExportBuffer को कॉल करें।
रिटर्न
GW2RegisterExportMemory फ़ंक्शन GW2_RetStatus enumeration को int में convert करके return करता है। यदि कोई त्रुटि हुई है, तो मान negative होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
A GlasswallException exception will be thrown if session is invalid.
सारांश - डेटा प्राप्त करें
import com.glasswall.core2javabridge.*;
public byte[] GetExportBuffer(int session) throws GlasswallException
विवरण
GetExportBuffer फ़ंक्शन session द्वारा निर्दिष्ट session से जुड़े export buffer की सामग्री प्राप्त करता है।
रिटर्न
GetExportBuffer फ़ंक्शन exported file को शामिल करने वाला byte[] return करता है। यदि GW2RegisterExportMemory और GW2RunSession को कॉल नहीं किया गया है, या यदि file non-conforming है, तो यह null होगा।
A GlasswallException exception will be thrown if session is invalid.
सारांश
दिए गए session के लिए export की जाने वाली फ़ाइल को register करता है। export फ़ाइल session के run_session call के दौरान बनाई जाएगी।
def register_export(self, session: int, output_file: Optional[str] = None):
""" Registers a file to be exported for the given session. The export file will be created during the session's run_session call.
Args:
session (int): The session integer.
output_file (Optional[str]): Default None. The file path where the export will be written. None exports the file in memory.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attribute 'status' indicating the result of the function call and 'session', the session integer. 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): एक GwReturnObj instance जिसमें attribute 'status' फ़ंक्शन call के परिणाम को दर्शाता है और 'session', session integer है। यदि output_file None है (memory mode), तो 'buffer' और 'buffer_length' शामिल होते हैं, जिनमें file content और file size होता है।
status attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।
सारांश
यह फ़ंक्शन किसी निर्दिष्ट session के लिए एक export memory location register करता है।
/**
*
* @param {number} session The ID of the session.
* @param {string} exportFileBuffer A pointer to the specified memory location.
* @param {number} exportLength The size of the file buffer.
*/
GW2RegisterExportMemory(session, exportFileBuffer, exportLength)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।