GW2RegisterAnalysisFile
Ang GW2RegisterAnalysisFile ay nagrerehistro ng lokasyon kung saan ise-save ang isang analysis report sa disk para sa isang Session. Ang paggamit ng function na ito ay nag-a-activate ng Analysis Process para sa Session.
- C++
- C#
- Java
- Python
- JavaScript
Buod
Iniimbak ng function na GW2RegisterAnalysisFile sa file na ang pangalan ay itinuturo ng string na analysisFilePath ang analysis report na ginawa ng matagumpay na pagpapatakbo ng API function na runSession na gumamit ng session na session. Ang paggamit ng function na ito ay nag-a-activate ng Analysis Process Mode para sa session.
#include "glasswall.core2.api.h"
int GW2RegisterAnalysisFile(Session session,
const char *analysisFilePath,
Analysis_format format);
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Halimbawa
#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 */
Buod
public int RegisterAnalysisFile(
int session,
string analysisFilePath,
int analysisFormat)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.
Buod
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
Tandaan
Na-update ang mga parameter ng function na GW2RegisterAnalysisFile upang gumamit ng String kapalit ng byte[]. Ang orihinal na function ay deprecated na.
Sumangguni sa API Overview/Return types para sa mga wastong enumerator para sa format.
Ibinabalik
Ang function na GW2RegisterAnalysisFile 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 NullPointerException exception ang ita-throw kung ang analysisFilePath ay null o walang laman.
Isang GlasswallException exception ang ita-throw kung ang session ay invalid, o kung ang analysisFilePath ay hindi makuha.
Buod
Nagrerehistro ng analysis file para sa ibinigay na session. Malilikha ang analysis file sa panahon ng run_session call ng session.
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.
"""
Ibinabalik
gw_return_object (glasswall.GwReturnObj): Isang instance ng GwReturnObj na may mga attribute na 'status', 'session', 'analysis_format'. Kung ang output_file ay None (memory mode), kasama ang 'buffer' at 'buffer_length' na naglalaman ng nilalaman ng file at laki ng file. Kung ang output_file ay hindi None (file mode), kasama ang 'output_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 tinukoy na file sa isang tinukoy na session, alinsunod sa isang tinukoy na format
/**
*
* @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)
Ibinabalik
Nagbabalik ng integer na GW2_RetStatus enum value. Ang mga negatibong numero ay nagpapahiwatig ng pagkabigo.