Rosetta
Namespaces | Macros | Functions
util.cc File Reference

General utility functions for parsing an XSD without needing access to Rosetta's higher libraries. Useful for UI development. More...

#include <utility/xsd_util/util.hh>
#include <utility/exit.hh>
#include <utility/string_util.hh>

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 0.
 
 utility::xsd_util
 

Macros

#define MAX_HUMAN_READABLE_RECURSION_LEVELS   10
 

Functions

void utility::xsd_util::generate_tag_given_options (std::stringstream &stringstream_out, std::string const &tag_name, utility::vector1< std::pair< std::string, std::string > > const &option_list, bool const terminal_slash, bool const triangular_brackets)
 Given the name of a tag (tag_name) and a list of options (as pairs of option name, option value), generate the tag. More...
 
std::string utility::xsd_util::get_module_type_as_it_appears_in_xsd (RosettaModuleType const module_type)
 Given a type of module, get its name as it appears in the RosettaScripts xsd. More...
 
std::string utility::xsd_util::get_specific_module_name_as_it_appears_in_xsd (std::string const &module_name, RosettaModuleType const module_type)
 Given a name of a specific module (e.g. "FastDesign") of a particular type (e.g. mover), return the name as it appears in the XSD (e.g. "mover_FastDesign_type"). More...
 
RosettaModuleOptionType utility::xsd_util::get_option_type_from_name (std::string const &, std::string const &type)
 Given an option type that appears in the xsd (e.g. "xs:string", "rosetta_bool", etc.), convert it to an enum. More...
 
void utility::xsd_util::get_rosetta_module_options_from_xsd (std::string const &xsd, RosettaModuleType const module_type, std::string const &module_name, std::string &module_description_out, utility::vector1< std::tuple< RosettaModuleOptionType, std::string, std::string > > &option_list_out, utility::vector1< std::tuple< std::string, std::string, platform::Size, platform::Size > > &sub_element_information_out)
 Given an xsd for RosettaScripts and the name of a module of a given type, get its first-level child options (as a vector of pairs of <RosettaModuleOptionType, option name>). More...
 
bool utility::xsd_util::recursively_find_module_in_xsd (xmlNode *const parent_node, std::string const &module_name, xmlNode **module_node)
 Given an xsd for Rosettascripts and the name of a particular ComplexType element or sub-element, get a pointer to its XMLnode. More...
 
void utility::xsd_util::get_choice_min_and_max (xmlNode *choice_node, platform::Size &choice_min, platform::Size &choice_max)
 Given a "xs:choice" element in an XSD, get the minOccurs and maxOccurs options and store them in unsigned integers. More...
 
void utility::xsd_util::get_mover_names_from_xsd (std::string const &xsd, utility::vector1< std::string > &mover_names_out)
 Given an xsd for RosettaScripts, get all of the names of mover elements. More...
 
void utility::xsd_util::get_filter_names_from_xsd (std::string const &xsd, utility::vector1< std::string > &filter_names_out)
 Given an xsd for RosettaScripts, get all of the names of filter elements. More...
 
void utility::xsd_util::get_task_operation_names_from_xsd (std::string const &xsd, utility::vector1< std::string > &taskop_names_out)
 Given an xsd for RosettaScripts, get all of the names of task operation elements. More...
 
void utility::xsd_util::get_residue_level_task_operation_names_from_xsd (std::string const &xsd, utility::vector1< std::string > &rltaskop_names_out)
 Given an xsd for RosettaScripts, get all of the names of residue-level task operation elements. More...
 
void utility::xsd_util::get_residue_selector_names_from_xsd (std::string const &xsd, utility::vector1< std::string > &residue_selector_names_out)
 Given an xsd for RosettaScripts, get all of the names of residue selector elements. More...
 
void utility::xsd_util::get_module_names_from_xsd (std::string const &xsd, std::string const &module_name, utility::vector1< std::string > &names_out)
 Given an xsd for RosettaScripts, get all of the names of a particular type of Rosetta module. More...
 
std::string utility::xsd_util::get_node_option (xmlNode *node, std::string const &optionname)
 Given a node in an XML tree, get the value of an option. More...
 
std::string utility::xsd_util::generate_human_readable_summary (std::string const &xsd, std::string const &component_name, std::string const &component_type)
 Go through an XSD and generate a human-readable description of a particular Rosetta module. More...
 
void utility::xsd_util::generate_human_readable_recursive (xmlNode *rootnode, std::stringstream &description, std::stringstream &tags, std::stringstream &options, platform::Size const level, std::string const &complextype, std::string const &tag_name_to_print)
 Go through an XSD XML and generate a human-readable version, recursively. More...
 
std::string utility::xsd_util::get_tag_name (xmlNode *node)
 Given a node in an XML tree representing a tag, get the string that starts the tag. (e.g. "DeclareBond" in "<DeclareBond .... />"). More...
 
void utility::xsd_util::output_all_tag_options (xmlNode *node, std::string const &tagname, platform::Size const level, std::stringstream &tags, std::stringstream &options)
 Given a node in an XML tree representing a tag, get all options in that tag, write their descriptions to "options", and write their names and types to "tags". More...
 
void utility::xsd_util::generate_human_readable_documentation (xmlNode *parent_node, std::stringstream &outstream)
 Given a documentation node in an XML tree, parse out the documentation and print it. More...
 
std::string utility::xsd_util::get_type_name (std::string const &xsd_type)
 Given an XSD simple type (e.g. "rosetta_bool"), return a more human-readable type (e.g. "bool"). More...
 

Detailed Description

General utility functions for parsing an XSD without needing access to Rosetta's higher libraries. Useful for UI development.

Author
Vikram K. Mulligan (vmull.nosp@m.ig@u.nosp@m.w.edu).

Macro Definition Documentation

◆ MAX_HUMAN_READABLE_RECURSION_LEVELS

#define MAX_HUMAN_READABLE_RECURSION_LEVELS   10