GW2RegisterReportFile
ฟังก์ชัน GW2RegisterReportFile ใช้ลงทะเบียนพาธไฟล์ที่จะใช้วางไฟล์บันทึกทางวิศวกรรม API นี้จะสร้างไฟล์รายงาน เฉพาะสำหรับ debug builds ของ Glasswall Engine เท่านั้น
- C++
- C#
- Java
- Python
- JavaScript
สรุป
สำหรับเซสชัน session ฟังก์ชัน GW2RegisterReportFile จะลงทะเบียนชื่อไฟล์ที่จะใช้วางไฟล์บันทึกทางวิศวกรรม ชื่อนี้คือสตริงที่ reportFilePathName ชี้อยู่
#include "glasswall.core2.api.h"
int GW2RegisterReportFile(Session session, const char *reportFilePathName);
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว
สรุป
public int RegisterReportFile(
int session,
string reportFilePathName)
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว
สรุป
import com.glasswall.core2javabridge.*;
public int GW2RegisterReportFile(int session, String reportFilePath) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterReportFile(int session, byte[] reportFilePath) throws GlasswallException, NullPointerException
คำอธิบาย
พารามิเตอร์ของฟังก์ชัน GW2RegisterReportFile ได้รับการอัปเดตให้ใช้ String แทน byte[] แล้ว ฟังก์ชันดั้งเดิมถูกเลิกใช้งานแล้ว
ส่งกลับ
ฟังก์ชัน GW2RegisterReportFile จะส่งคืนค่า enumeration GW2_RetStatus ที่แปลงเป็น int ค่าเป็นลบจะหมายถึงเกิดข้อผิดพลาด 0 หมายถึงสำเร็จ โปรดดูรายละเอียดใน API Overview/Return types
จะมีการโยนข้อยกเว้น NullPointerException หาก reportFilePath เป็น null หรือว่างเปล่า
จะมีการโยนข้อยกเว้น GlasswallException หาก session ไม่ถูกต้อง หากไม่สามารถดึง reportFilePath ได้ หรือหากไม่สามารถแปลง reportFilePath เป็น UTF-8 ได้
สรุป
ลงทะเบียนชื่อไฟล์ที่จะใช้วางไฟล์บันทึกทางวิศวกรรม
def register_report_file(self, session: int, output_file: str):
""" Register the report file path for the given session.
Args:
session (int): The session integer.
output_file (str): The file path of the report file.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'session', 'output_file', 'status'.
"""
ส่งกลับ
gw_return_object (glasswall.GwReturnObj): อินสแตนซ์ GwReturnObj ที่มีแอตทริบิวต์ 'session', 'output_file', 'status'.
สรุป
ฟังก์ชันนี้ลงทะเบียนชื่อไฟล์ที่จะใช้วางไฟล์บันทึกทางวิศวกรรม
/**
* @param {number} session The ID of the session.
* @param {string} reportFilePathName The path of the file to be registered.
*/
GW2RegisterReportFile(session, reportFilePathName)
ส่งกลับ
ส่งกลับค่า enum GW2_RetStatus แบบจำนวนเต็ม ตัวเลขติดลบหมายถึงล้มเหลว