GW2RegisterAnalysisFile
GW2RegisterAnalysisFile डिस्क पर विश्लेषण रिपोर्ट संग्रहीत करने के स्थान को किसी Session के लिए पंजीकृत करता है। इस function का उपयोग Session के लिए Analysis Process को सक्रिय करता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
GW2RegisterAnalysisFile function उस file में, जिसका नाम string analysisFilePath द्वारा इंगित किया गया है, API function runSession के सफल run द्वारा उत्पन्न विश्लेषण रिपोर्ट संग्रहीत करता है, जिसने session session का उपयोग किया था। इस function का उपयोग session के लिए Analysis Process Mode को सक्रिय करता है।
#include "glasswall.core2.api.h"
int GW2RegisterAnalysisFile(Session session,
const char *analysisFilePath,
Analysis_format format);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
उदाहरण
#include "glasswall.core2.api.h"
Session session = GW2OpenSession();
if (!session)
/* deal with error */
else
if (GW2RegisterAnalysisFile(session, "c:\\analysis_files\\analysis_file_023.xml", AF_XML) < 0)
/* deal with error */
else
/* analysis file registered */
/* later */
if (GW2CloseSession(session))
/* error closing session */
सारांश
public int RegisterAnalysisFile(
int session,
string analysisFilePath,
int analysisFormat)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
सारांश
import com.glasswall.core2javabridge.*;
public int GW2RegisterAnalysisFile(int session, String analysisFilePath, int format) throws GlasswallException, NullPointerException
(Deprecated)
public int GW2RegisterAnalysisFile(int session, byte[] analysisFilePath, int format) throws GlasswallException, NullPointerException
नोट
The GW2RegisterAnalysisFile function parameters have been updated to use String in place of byte[]. The original function has been deprecated.
format के लिए मान्य enumerators हेतु API Overview/Return types देखें।
रिटर्न
GW2RegisterAnalysisFile फ़ंक्शन GW2_RetStatus enumeration को int में परिवर्तित करके लौटाता है। यदि कोई त्रुटि हुई है, तो मान negative होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
A NullPointerException exception will be thrown if analysisFilePath is null or empty.
A GlasswallException exception will be thrown if session is invalid, or if the analysisFilePath could not be retrieved.
सारांश
दिए गए session के लिए एक analysis file पंजीकृत करता है। analysis file session के run_session call के दौरान बनाई जाएगी।
def register_analysis(self, session: int, output_file: Optional[str] = None):
""" Registers an analysis file for the given session. The analysis 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 analysis will be written. None returns the analysis as bytes.
Returns:
gw_return_object (glasswall.GwReturnObj): A GwReturnObj instance with the attributes 'status', 'session', 'analysis_format'. If output_file is None (memory mode), 'buffer', and 'buffer_length' are included containing the file content and file size. If output_file is not None (file mode) 'output_file' is included.
"""
रिटर्न
gw_return_object (glasswall.GwReturnObj): 'status', 'session', 'analysis_format' attributes के साथ एक GwReturnObj instance। यदि output_file None है (memory mode), तो file content और file size को शामिल करते हुए 'buffer' और 'buffer_length' शामिल होते हैं। यदि output_file None नहीं है (file mode) तो 'output_file' शामिल होता है।
status attribute एक integer GW2_RetStatus enum value है। Negative numbers विफलता को दर्शाते हैं।
सारांश
यह फ़ंक्शन निर्दिष्ट format के अनुरूप, निर्दिष्ट session के साथ एक निर्दिष्ट file को पंजीकृत करता है।
/**
*
* @param {number} session The ID of the session.
* @param {string} analysisFilePathName The path of the file to be registered.
* @param {number} format The specified format.
*/
GW2RegisterAnalysisFile(
session,
analysisFilePathName,
format)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।