Public Member Functions | Private Attributes | List of all members
gtwrap.xml_parser.xml_parser.XMLDocParser Class Reference

Public Member Functions

def __init__ (self)
 
def determine_documenting_index (self, str cpp_class, str cpp_method, list method_args_names, list member_defs)
 
def extract_docstring (self, str xml_folder, str cpp_class, str cpp_method, 'list[str]' method_args_names)
 
def filter_member_defs (self, list maybe_member_defs, list method_args_names)
 
def get_formatted_docstring (self, 'xml.etree.ElementTree.Element' member_def, list ignored_params)
 
def get_member_defs (self, str xml_folder, str cpp_class, str cpp_method)
 
def parse_xml (self, str xml_file)
 
def print_if_verbose (self, str text)
 

Private Attributes

 _memory
 
 _verbose
 

Detailed Description

Parses and extracts docs from Doxygen-generated XML.

Definition at line 7 of file xml_parser.py.

Constructor & Destructor Documentation

◆ __init__()

def gtwrap.xml_parser.xml_parser.XMLDocParser.__init__ (   self)

Definition at line 12 of file xml_parser.py.

Member Function Documentation

◆ determine_documenting_index()

def gtwrap.xml_parser.xml_parser.XMLDocParser.determine_documenting_index (   self,
str  cpp_class,
str  cpp_method,
list  method_args_names,
list  member_defs 
)
Determine which member definition to retrieve documentation from, if there are multiple.

Args:
    cpp_class (str): The name of the C++ class that contains the function whose docstring is to be extracted.
    cpp_method (str): The name of the C++ method whose docstring is to be extracted.
    method_args_names (list): A list of the names of the cpp_method's parameters.
    member_defs (list): All of the member definitions of cpp_class which match cpp_method in name 
and whose arguments have the same names as method_args_names.

Returns:
    int: The index indicating which member definition to document.

Definition at line 193 of file xml_parser.py.

◆ extract_docstring()

def gtwrap.xml_parser.xml_parser.XMLDocParser.extract_docstring (   self,
str  xml_folder,
str  cpp_class,
str  cpp_method,
'list[str]'  method_args_names 
)
Extract the docstrings for a C++ class's method from the Doxygen-generated XML.
    
Args:
    xml_folder (str): The path to the folder that contains all of the Doxygen-generated XML.
    cpp_class (str): The name of the C++ class that contains the function whose docstring is to be extracted.
    cpp_method (str): The name of the C++ method whose docstring is to be extracted.
    method_args_names (list): A list of the names of the cpp_method's parameters.

Definition at line 34 of file xml_parser.py.

◆ filter_member_defs()

def gtwrap.xml_parser.xml_parser.XMLDocParser.filter_member_defs (   self,
list  maybe_member_defs,
list  method_args_names 
)
Remove member definitions which do not match the supplied argument names list.

Args:
    maybe_member_defs (list): The list of all member definitions in the class which share the same name.
    method_args_names (list): The list of argument names in the definition of the function whose documentation is desired.
Supplying the argument names allows for the filtering of overloaded functions with the same name but different arguments.

Returns:
    tuple[list, list]: (the filtered member definitions, parameters which should be ignored because they are optional)

Definition at line 114 of file xml_parser.py.

◆ get_formatted_docstring()

def gtwrap.xml_parser.xml_parser.XMLDocParser.get_formatted_docstring (   self,
'xml.etree.ElementTree.Element'  member_def,
list  ignored_params 
)
Gets the formatted docstring for the supplied XML element representing a member definition.

Args:
    member_def (xml.etree.ElementTree.Element): The member definition to document.
    ignored_params (list): The optional parameters which should be ignored, if any.

Returns:
    str: The formatted docstring.

Definition at line 229 of file xml_parser.py.

◆ get_member_defs()

def gtwrap.xml_parser.xml_parser.XMLDocParser.get_member_defs (   self,
str  xml_folder,
str  cpp_class,
str  cpp_method 
)
Get all of the member definitions in cpp_class with name cpp_method.

Args:
    xml_folder (str): The folder containing the Doxygen XML documentation.
    cpp_class (str): The name of the C++ class that contains the function whose docstring is to be extracted.
    cpp_method (str): The name of the C++ method whose docstring is to be extracted.

Returns:
    list: All of the member definitions in cpp_class with name cpp_method.

Definition at line 63 of file xml_parser.py.

◆ parse_xml()

def gtwrap.xml_parser.xml_parser.XMLDocParser.parse_xml (   self,
str  xml_file 
)
Get the ElementTree of an XML file given the file name.
If an error occurs, prints a warning and returns None.

Definition at line 20 of file xml_parser.py.

◆ print_if_verbose()

def gtwrap.xml_parser.xml_parser.XMLDocParser.print_if_verbose (   self,
str  text 
)
Print text if the parser is in verbose mode.

Definition at line 282 of file xml_parser.py.

Member Data Documentation

◆ _memory

gtwrap.xml_parser.xml_parser.XMLDocParser._memory
private

Definition at line 14 of file xml_parser.py.

◆ _verbose

gtwrap.xml_parser.xml_parser.XMLDocParser._verbose
private

Definition at line 18 of file xml_parser.py.


The documentation for this class was generated from the following file:


gtsam
Author(s):
autogenerated on Fri Mar 28 2025 03:16:31