Class
ToolDocContainer for string documentation on a command line tool.
Container for string documentation on a command line tool.
Implements | AssignableConcept |
---|---|
All Impl'd | AssignableConcept |
Defined in | <seqan/arg_parse.> |
Signature |
class ToolDoc;
|
Member Function Overview
-
ToolDoc::ToolDoc()
Constructor
Member Functions Inherited From AssignableConcept
Interface Function Overview
-
void addListItem(toolDoc, key, value);
Add a list item to a ToolDoc. -
void addSection(toolDoc, title);
Add a section with the given title. -
void addSubSection(toolDoc, title);
Add a subsection with the given title. -
void addText(toolDoc, text[, isParagraph]);
Add a text line/paragraph to ToolDoc. -
void append(a, b);
Append two ToolDoc objects. -
void clearEntries(toolDoc);
Clear entries from ToolDoc. -
CharString getCategory(toolDoc);
Get the tool category. -
CharString getDate(toolDoc);
Get the date. -
CharString getManTitle(toolDoc);
Get the tool man page title of. -
CharString getName(toolDoc);
Get the tool name. -
CharString getShortDescription(toolDoc);
Get the tool short description. -
CharString getVersion(toolDoc);
Get the tool version string. -
void print(stream, toolDoc, format);
Print ToolDoc object in a given format. -
void setName(toolDoc, name);
Set the tool name. -
void setName(toolDoc, str);
Set the date string. -
void setTitle(toolDoc, title);
Set the man title. -
void setName(toolDoc, name);
Set the tool name. -
void setShortDescription(toolDoc, text);
Set the tool short description. -
void setName(toolDoc, str);
Set the tool version string.
Interface Functions Inherited From AssignableConcept
Detailed Description
Remarks
This class is generally not used directly by the user but through ArgumentParser. It allows to store and represent all information related to a command line tool that would normally go into a man page. It can be printed to STL streams in different formats, currently plain text, HTML and man pages are supported.
You can also use basic formatting in text. This formatting is tailored to the usage on the command line. Use \fB to start bold font, \fI to start italic font and \fP to use the previous font (of course, use correct escaping of the backslash in C strings, so use "\\fB", "\\fI", and "\\fP" in your code.
Examples
The following shows a brief example of how to use ToolDoc.
ToolDoc doc;
setName(doc, "RazerS");
setShortDescription(doc, "Read mapping with controllable sensitivity.");
setDate(doc, "04 March 2012");
setVersion(doc, "1.0");
setCategory(doc, "Read Mapping");
setManTitle(doc, "SeqAn Apps Reference Manual");
addSection(doc, "Synopsis");
addText(doc, "\\fBrazers\\fP [\\fIOPTIONS\\fP] \\fIREFERENCE\\fP \\fIREADS\\fP", false);
addText(doc,
"\\fBrazers\\fP [\\fIOPTIONS\\fP] \\fIREFERENCE\\fP \\fILEFT_READS\\fP "
"\\fIRIGHT_READS\\fP", false);
addSection(doc, "Description");
addText(doc,
"RazerS is a read mapper with controllable, sensitivity. This "
"means that you can find all read matches in the reference sequence "
"and optionally, you can trade lower sensitivity for better "
"performance.");
addText(doc,
"What's special about RazerS is that you can control the sensitivity.");
addSection(doc, "Options");
addSubSection(doc, "Main Options");
addListItem(doc, "\\fB-id\\fP, \\fB--indels\\fP",
"Enable mapping with indels enabled.");
addListItem(doc, "\\fB-i\\fP, \\fB--identity\\fP \\fIIDENTITY\\fP",
"Set minimal identity of matches to find.");
print(std::cout, doc, "text");
See Also
Member Functions Detail
ToolDoc::ToolDoc()
Constructor
Data Races
Thread safety unknown!
Interface Functions Detail
void addListItem(toolDoc, key, value);
Add a list item to a ToolDoc.
Parameters
toolDoc
|
The ToolDoc object to add the list item to. |
---|---|
key
|
The key for the list (CharString). |
value
|
The value for the list (CharString). |
Data Races
Thread safety unknown!
void addSection(toolDoc, title);
Add a section with the given title.
Parameters
toolDoc
|
The ToolDoc object to add a section for. |
---|---|
title
|
The section title (CharString). |
Data Races
Thread safety unknown!
void addSubSection(toolDoc, title);
Add a subsection with the given title.
Parameters
toolDoc
|
The ToolDoc object to add a subsection for. |
---|---|
title
|
The subsection title (CharString). |
Data Races
Thread safety unknown!
void addText(toolDoc, text[, isParagraph]);
Add a text line/paragraph to ToolDoc.
Parameters
toolDoc
|
The ToolDoc to add the text to. |
---|---|
text
|
The text to add (CharString). |
isParagraph
|
Whether to insert as paragraph or just a line (only one line break if not a paragraph). |
Data Races
Thread safety unknown!
void append(a, b);
Append two ToolDoc objects.
Parameters
a
|
This object is updated |
---|---|
b
|
This object is appended to b. |
Data Races
Thread safety unknown!
void clearEntries(toolDoc);
Clear entries from ToolDoc.
Parameters
toolDoc
|
The ToolDoc object to clear entries from. |
---|
Data Races
Thread safety unknown!
CharString getCategory(toolDoc);
Get the tool category.
Parameters
toolDoc
|
The ToolDoc object to the get the category for. |
---|
Returns
CharString |
Resulting category (CharString). |
---|
Data Races
Thread safety unknown!
CharString getDate(toolDoc);
Get the date.
Parameters
toolDoc
|
The ToolDoc object to the get the date from. |
---|
Returns
CharString |
Resulting date string (CharString). |
---|
Data Races
Thread safety unknown!
CharString getManTitle(toolDoc);
Get the tool man page title of.
Parameters
toolDoc
|
The ToolDoc object to the get the man page title. |
---|
Returns
CharString |
Resulting man page title (CharString). |
---|
Data Races
Thread safety unknown!
CharString getName(toolDoc);
Get the tool name.
Parameters
toolDoc
|
The ToolDoc object to the get the name for. |
---|
Returns
CharString |
Resulting name (CharString). |
---|
Data Races
Thread safety unknown!
CharString getShortDescription(toolDoc);
Get the tool short description.
Parameters
toolDoc
|
The ToolDoc object to the get the short description for. |
---|
Returns
CharString |
Resulting short description (CharString). |
---|
Data Races
Thread safety unknown!
CharString getVersion(toolDoc);
Get the tool version string.
Parameters
toolDoc
|
The ToolDoc object to the get the version string. |
---|
Returns
CharString |
Resulting version string (CharString). |
---|
Data Races
Thread safety unknown!
void print(stream, toolDoc, format);
Print ToolDoc object in a given format.
Parameters
stream
|
The std::ostream to write to. |
---|---|
toolDoc
|
The ToolDoc to print. |
format
|
The format, one of {"html", "man", "txt"}. |
Data Races
Thread safety unknown!
void setName(toolDoc, name);
Set the tool name.
Parameters
toolDoc
|
The ToolDoc object to the set the name for. |
---|---|
name
|
The name of the tool (CharString). |
Data Races
Thread safety unknown!
void setName(toolDoc, str);
Set the date string.
Parameters
toolDoc
|
The ToolDoc object to the set the date string for. |
---|---|
str
|
The date string of the tool (CharString). |
Data Races
Thread safety unknown!
void setTitle(toolDoc, title);
Set the man title.
Parameters
toolDoc
|
The ToolDoc object to the set the title for. |
---|---|
title
|
The title of the tool (CharString). |
Data Races
Thread safety unknown!
void setName(toolDoc, name);
Set the tool name.
Parameters
toolDoc
|
The ToolDoc object to the set the name for. |
---|---|
name
|
The name of the tool (CharString). |
Data Races
Thread safety unknown!
void setShortDescription(toolDoc, text);
Set the tool short description.
Parameters
toolDoc
|
The ToolDoc object to the set the short description for. |
---|---|
text
|
The short description of the tool (CharString). |
Data Races
Thread safety unknown!
void setName(toolDoc, str);
Set the tool version string.
Parameters
toolDoc
|
The ToolDoc object to the set the version string for. |
---|---|
str
|
The version string of the tool (CharString). |
Data Races
Thread safety unknown!