The Open Master Hearing Aid (openMHA)  openMHA
Open community platform for hearing aid algorithm research
generatemhaplugindoc.cpp File Reference

Classes

class  plug_wrapperI
 
class  io_wrapper
 
class  plug_wrapper
 
class  latex_doc_t
 Class to access the information stored in the plugin source code's MHAPLUGIN_DOCUMENTATION macro. More...
 

Functions

std::string conv2latex (std::string s, bool iscolored=false)
 Escapes various character sequences in texts not intended to be processed by LaTeX for processing by LaTeX. More...
 
static void print_plugin_references (const std::set< std::string > &all_categories, std::map< std::string, std::vector< std::string > > main_category_plugins, std::map< std::string, std::vector< std::string > > additional_category_plugins, std::ofstream &ofile, const std::string &category_macro)
 Function prints an overview of all categories and their associated plugins into the document. More...
 
std::vector< std::string > create_latex_doc (std::map< std::string, std::string > &doc, const std::string &plugname, const std::string &plugin_macro)
 Loads the plugin, creates the latex documentation for the plugin, and adds the latex documentation for this plugin to the plugin's main category entry in doc. More...
 
int main (int argc, char **argv)
 

Function Documentation

◆ conv2latex()

std::string conv2latex ( std::string  s,
bool  iscolored = false 
)

Escapes various character sequences in texts not intended to be processed by LaTeX for processing by LaTeX.

Focus is on correct display of symbols contained in these texts. E.g. the help texts of MHA configuration variables can be processed by this function. The contents of the MHAPLUGIN_DOCUMENTATION is already in LaTeX format and should not be processed by this function.

Returns
A copy of s with various symbols escaped for LaTeX processing
Parameters
sText not ready for LaTeX
iscoloredif true, the complete returned text is surrounded with "\\color{monitorcolor}{" and "}"

◆ print_plugin_references()

static void print_plugin_references ( const std::set< std::string > &  all_categories,
std::map< std::string, std::vector< std::string > >  main_category_plugins,
std::map< std::string, std::vector< std::string > >  additional_category_plugins,
std::ofstream &  ofile,
const std::string &  category_macro 
)
static

Function prints an overview of all categories and their associated plugins into the document.

Parameters
all_categoriesA sorted container with all category names
main_category_pluginsmap of main categories to plugin names
additional_category_pluginsmap of tags to plugin names
ofileLatex document is produced by writing output to this stream

◆ create_latex_doc()

std::vector<std::string> create_latex_doc ( std::map< std::string, std::string > &  doc,
const std::string &  plugname,
const std::string &  plugin_macro 
)

Loads the plugin, creates the latex documentation for the plugin, and adds the latex documentation for this plugin to the plugin's main category entry in doc.

Returns
the vector of all categories.
Parameters
docmap of main categories to a string containint the documentation of all plugins in that categories. The documentation of the current plugin will be appended to the existing documentation of its main category. Will be created if non-existant.
plugnameName of the MHA plugin to process
plugin_macroname of the LaTeX section macro that documents a single plugin (e.g. "section", "subsection", "subsubsection", ...)

◆ main()

int main ( int  argc,
char **  argv 
)