GW2RegisterExportFile
ฟังก์ชัน GW2RegisterExportFile จะลงทะเบียนพาธไฟล์ที่ระบุกับเซสชัน - ข้อมูลที่ส่งออกจะถูกวางไว้ในไฟล์นั้น การใช้ฟังก์ชันนี้จะเปิดใช้งาน Export Process Mode สำหรับเซสชัน
- C++
- C#
- Java
- Python
- JavaScript
สรุป
ฟังก์ชัน GW2RegisterExportFile จะลงทะเบียนไฟล์ที่มีชื่อเป็นสตริงซึ่งถูกชี้โดย exportFilePath กับเซสชันที่ระบุโดย session. ข้อมูลที่ส่งออกจะถูกวางไว้ในไฟล์นั้น การใช้ฟังก์ชันนี้จะเปิดใช้งาน Export Process Mode สำหรับเซสชัน
#include "glasswall.core2.api.h"
int GW2RegisterExportFile(
Session session,
const char *exportFilePath);
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว
สรุป
public int RegisterExportFile(
int session,
string exportFilePath)
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว
สรุป
import com.glasswall.core2javabridge.*;
public int GW2RegisterExportFile(int session, String exportFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterExportFile(int session, byte[] exportFilePath) throws GlasswallException, NullPointerException
หมายเหตุ
พารามิเตอร์ของฟังก์ชัน GW2RegisterExportFile ได้รับการอัปเดตให้ใช้ String แทน byte[] แล้ว ฟังก์ชันดั้งเดิมถูกเลิกใช้งานแล้ว
ส่งกลับ
ฟังก์ชัน GW2RegisterExportFile จะส่งคืนค่า enumeration GW2_RetStatus ที่แปลงเป็น int ค่าจะเป็นค่าติดลบหากเกิดข้อผิดพลาด 0 หมายถึงสำเร็จ โปรดดูรายละเอียดใน API Overview/Return types
จะมีการโยน exception NullPointerException หาก exportFilePath เป็น null หรือว่างเปล่า
จะมีการโยน exception GlasswallException หาก session ไม่ถูกต้อง หากไม่สามารถดึงข้อมูล exportFilePath ได้ หรือหากไม่สามารถแปลง exportFilePath เป็น UTF-8 ได้
สรุป
ลงทะเบียนไฟล์ที่จะส่งออกสำหรับ session ที่กำหนด ไฟล์ส่งออกจะถูกสร้างขึ้นระหว่างการเรียก run_session ของ 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.
"""
ส่งกลับ
gw_return_object (glasswall.GwReturnObj): อินสแตนซ์ GwReturnObj ที่มีแอตทริบิวต์ 'status' ระบุผลลัพธ์ของการเรียกฟังก์ชัน และ 'session' ซึ่งเป็นจำนวนเต็มของ session หาก output_file เป็น None (โหมดหน่วยความจำ) จะมี 'buffer' และ 'buffer_length' รวมอยู่ด้วย ซึ่งประกอบด้วยเนื้อหาไฟล์และขนาดไฟล์
แอตทริบิวต์ status เป็นค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงความล้มเหลว
สรุป
ฟังก์ชันนี้ลงทะเบียนไฟล์ส่งออกที่ระบุไว้กับ session ที่ระบุ
/**
* @param {number} session The ID of the session.
* @param {string} exportFilePath The path of the file to be registered.
*/
GW2RegisterExportFile(session, exportFilePath)
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว