GW2RegisterExportMemory
Ang function na GW2RegisterExportMemory ay nagrerehistro ng lokasyon sa memory upang paglagyan ng na-export na file. Ang paggamit ng function na ito ay nag-a-activate ng Export Process Mode para sa session.
- C++
- C#
- Java
- Python
- JavaScript
Buod
Para sa session na session, nirerehistro ng function na GW2RegisterExportMemory kung saan ilalagay ang na-export na content, at kung saan ilalagay ang laki sa bytes ng na-export na content. Isang pointer sa na-export na content ang ilalagay sa object na tinutukoy ng exportFileBuffer at ang laki sa bytes ng na-export na data ay ilalagay sa size_t object na tinutukoy ng exportFileBufferLength. Ide-delete ang na-export na content kapag isinara ang session gamit ang GW2CloseSession. Ang paggamit ng function na ito ay nag-a-activate ng Export Process Mode para sa session.
#include "glasswall.core2.api.h"
int GW2RegisterExportMemory(Session session,
char **exportFileBuffer,
size_t *exportFileBufferLength);
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
public int RegisterExportMemory(
int session,
out IntPtr exportFileBufferPtr,
ref UIntPtr exportBufferLengthPtr)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportMemory(int session) throws GlasswallException
Paglalarawan
Ang function na GW2RegisterExportMemory ay nagrerehistro ng isang memory buffer na gagamitin bilang output para sa na-export na file, para sa session na tinukoy ng session. Tawagin ang GetExportBuffer pagkatapos matawag ang GW2RunSession upang makuha ang na-export na data.
Ibinabalik
Ang function na GW2RegisterExportMemory 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 GlasswallException exception ang ita-throw kung hindi valid ang session.
Buod - Kunin ang Data
import com.glasswall.core2javabridge.*;
public byte[] GetExportBuffer(int session) throws GlasswallException
Paglalarawan
Kinukuha ng function na GetExportBuffer ang mga nilalaman ng export buffer na nauugnay sa session na tinukoy ng session.
Ibinabalik
Ang function na GetExportBuffer ay nagbabalik ng isang byte[] na naglalaman ng na-export na file. Ito ay magiging null kung ang GW2RegisterExportMemory at GW2RunSession ay hindi pa natawag, o kung ang file ay non-conforming.
Isang GlasswallException exception ang ita-throw kung hindi valid ang session.
Buod
Nagrerehistro ng file na ie-export para sa ibinigay na session. Gagawin ang export file habang isinasagawa ang run_session call ng session.
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.
"""
Ibinabalik
gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may attribute na 'status' na nagsasaad ng resulta ng function call at 'session', ang integer ng session. Kung output_file ay None (memory mode), kasama ang 'buffer' at 'buffer_length' na naglalaman ng nilalaman ng file at laki ng file.
Ang status attribute ay isang integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng failure.
Buod
Ang function na ito ay nagrerehistro ng isang export memory location para sa isang tinukoy na session.
/**
*
* @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)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.