GW2GetAllIdInfo
Glasswall engine द्वारा पहचाने और रिपोर्ट किए गए प्रत्येक issue के साथ एक अद्वितीय issue ID जुड़ी होती है। यह API सभी संभावित issue ID numbers और उनके संबंधित उच्च-स्तरीय विवरणों का सारांश प्रदान करती है।
किसी session के लिए GW2GetAllIdInfo फ़ंक्शन एक output buffer में Glasswall Issue ID विवरणों और मान सीमाओं से भरा हुआ XML डेटा रखता है।
- C++
- C#
- Java
- Python
- JavaScript
सारांश
session session के लिए GW2GetAllIdInfo फ़ंक्शन outputBuffer द्वारा इंगित ऑब्जेक्ट में Glasswall Issue ID विवरणों और मान सीमाओं से भरे XML डेटा के लिए एक pointer रखता है। भरे गए output buffer की लंबाई, bytes में, bufferLength द्वारा इंगित size_t ऑब्जेक्ट में रखी जाती है।
#include "glasswall.core2.api.h"
int GW2GetAllIdInfo(
Session session,
size_t *bufferLength,
char **outputBuffer);
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। ऋणात्मक संख्याएँ विफलता को दर्शाती हैं। सफल होने पर, output buffer में XML file होती है।
उदाहरण
#include "glasswall.core2.api.h"
...
char *outbuf = NULL;
size_t buflen = 0;
if (GW2OpenSession())
/* error opening session*/
else
{
int status = GW2GetAllIdInfo(session, &buflen, &outbuf);
/* Buffer contains the XML file.
* Either process the data pointed to, or copy the data and process it
* after the session is closed
*/
if (GW2CloseSession())
/* error closing session */
}
सारांश
public int GetAllIdInfo(
int session,
ref UIntPtr bufferLength,
out IntPtr outputBuffer)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। ऋणात्मक संख्याएँ विफलता को दर्शाती हैं। सफल होने पर, output buffer में XML file होती है।
उदाहरण
...
UIntPtr bufferLength = UIntPtr.Zero;
IntPtr buffer = new IntPtr();
int session = glasswall.OpenSession();
int returnStatus = glasswall.GetAllIdInfo(session, ref bufferLength, out buffer);
using (StreamWriter writer = new StreamWriter(fileStream))
{
writer.WriteLine($"GW2GetAllIdInfo completed with status code {returnStatus}");
if ((int)bufferLength != 0)
{
WriteBytesToFile(Path.Combine(di.FullName, $"22 - GW2GetAllIdInfo.xml"),
glasswall.CreateArrayFromBuffer(buffer, bufferLength)
);
}
}
import com.glasswall.core2javabridge.*;
public String GW2GetAllIdInfoString(int session) throws GlasswallException
नोट
इस functionality के लिए पहले ID डेटा प्राप्त करने हेतु दो अलग-अलग function calls की आवश्यकता होती थी। अब इसे सुव्यवस्थित करके settings को String के रूप में लौटाया जाता है। मूल दो functions को deprecated कर दिया गया है।
रिटर्न
GW2GetAllIdInfoString function सभी Glasswall IDs का विवरण शामिल करने वाला एक String लौटाता है।
A GlasswallException exception will be thrown if session is invalid, or if all ID information could not be retrieved.
सारांश - अप्रचलित फ़ंक्शन
import com.glasswall.core2javabridge.*;
(Deprecated)
public int GW2GetAllIdInfo(int session) throws GlasswallException
public byte[] GetAllIDBuffer(int session) throws GlasswallException
विवरण - Deprecated Functions
GW2GetAllIdInfo function, session द्वारा निर्दिष्ट session के लिए सभी Glasswall IDs का विवरण internal All ID Buffer में output करता है। इस डेटा को GetAllIDBuffer function का उपयोग करके प्राप्त करें।
रिटर्न्स - अप्रचलित फ़ंक्शन
GW2GetAllIdInfo function, GW2_RetStatus enumeration को int में convert करके return करता है। यदि कोई त्रुटि हुई है, तो मान negative होगा। 0 सफलता को दर्शाता है। विवरण के लिए API Overview/Return types देखें।
GetAllIDBuffer एक byte array return करता है जिसमें Glasswall ID विवरण होते हैं। यदि GW2GetAllIdInfo को call नहीं किया गया है, तो यह null होगा।
A GlasswallException exception will be thrown if session is invalid, or if all ID information could not be retrieved.
सारांश
सभी Issue ID ranges और उनके group descriptions वाला XML प्राप्त करता है।
def get_all_id_info(self, output_file: Optional[str] = None, raise_unsupported: bool = True) -> str:
""" Retrieves the XML containing all the Issue ID ranges with their group descriptions
Args:
output_file (Optional[str], optional): The output file path where the analysis file will be written.
raise_unsupported (bool, optional): Default True. Raise exceptions when Glasswall encounters an error. Fail silently if False.
Returns:
all_id_info (str): A string XML analysis report containing all id info.
"""
रिटर्न
सभी id info वाला एक string XML analysis report।
सारांश
/**
* This function places a pointer in a specified location to XML data populated with
* Glasswall Issue ID descriptions and value ranges, for a specified session.
*
* @param {number} session The ID of the session.
* @param {number} bufferLength The length of the buffer.
* @param {string} outputBuffer The location of the output buffer.
*/
GW2GetAllIdInfo(
session,
bufferLength,
outputBuffer)
रिटर्न
एक पूर्णांक GW2_RetStatus enum मान लौटाता है। नकारात्मक संख्याएँ विफलता को दर्शाती हैं।
उदाहरण
const ref = require('ref-napi');
...
function buffer_to_string(buffer, buffer_size) {
if (!buffer.isNull() && ref.deref(buffer_size) > 0) {
return Buffer.from(ref.reinterpret(ref.deref(buffer), ref.deref(buffer_size), 0)).toString();
}
else {
return "";
}
}
...
let output_file_buffer = ref.alloc(ref.refType(ref.types.CString));
let output_buffer_size = ref.alloc(ref.types.size_t, 0);
let return_status = gw.GW2GetAllIdInfo(session_id, output_buffer_size, output_file_buffer);
let xml_string = buffer_to_string(output_file_buffer, output_buffer_size);
...