Any output file is expected to break into sections, which should be numbered in order and formatted consistently. This object will collect the elements of a section and provide methods for automatically writing them to an arbitrary output file.
More...
|
const std::string & | getOutputFileName () |
| Get the name of the output file.
|
|
int | getWidth () const |
| Get the target file width, the maximum number of characters on a typical line.
|
|
OutputSyntax | getSyntax () const |
| Get the output file syntax.
|
|
SectionComponent | getComponentType (int index) const |
| Get the type of one of the components of the section, based on the index in which the components will be listed out.
|
|
bool | isSubsection () const |
| Get an indication of whether the contents constitute a subsection.
|
|
void | setTitle (const std::string &title_in) |
| Set the title of the section (this can be used if the title was not specified in the constructor, and will overwritte any existing title).
|
|
void | designateSubsection (bool subsection_in=true) |
| Set whether the object contains a subsection or a full section.
|
|
void | reserve (SectionComponent item_kind, int item_count) |
| Reserve space for a number of blocks of narrative, ordered lists, or tables. This can be used to limit memory movement in cases when output sections may contain voluminous data.
|
|
void | addList (const OrderedList &list_in) |
| Add a new ordered list to the section.
|
|
void | addTable (const ReportTable &table_in) |
| Add a new table to the section.
|
|
|
| SectionContents (const std::string &title_in, const std::string &file_name_in, int width_in, bool subsection_in, int section_id_in, int subsection_id_in, ListEnumeration section_marking_in, ListEnumeration subsection_marking_in, OutputSyntax style_in, double table_precision_in) |
| The constructor takes critical components of the output format: target, format width, syntax. Specifying whether the information constitutes a subsection or not is optional, and as with other such details this can be specified after creation of the object.
|
|
| SectionContents (const std::string &title_in=std::string(""), const std::string &file_name_in=std::string(""), int width_in=default_output_file_width, OutputSyntax style_in=OutputSyntax::STANDALONE, double table_precision_in=1.0e-6) |
|
|
| SectionContents (const SectionContents &original)=default |
| With no const members or pointers to repair and all Standard Template Library components, the SectionContents can be copied or moved using default constructors and assignement operators.
|
|
| SectionContents (SectionContents &&original)=default |
|
SectionContents & | operator= (const SectionContents &original)=default |
|
SectionContents & | operator= (SectionContents &&original)=default |
|
|
int | getComponentCount () const |
| Get the number of components in the object.
|
|
int | getComponentCount (SectionComponent kind) const |
|
|
std::string | sectionAsString (OutputSyntax alt_style, int alt_width=-1, int alt_section_id=-1, int alt_subsection_id=-1, int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_marking=ListEnumeration::NONE, ListEnumeration nested_list_marking=ListEnumeration::NONE) const |
| Produce a string containing the section contents.
|
|
std::string | sectionAsString (int alt_section_id, int alt_subsection_id, int list_indent, int nested_list_indent, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
|
std::string | sectionAsString (int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
|
|
void | printSection (std::ofstream *foutp, int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
| Print the section contents to a file.
|
|
void | printSection (std::ostream *foutp, int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
|
void | printSection (const std::string &alt_file_name, PrintSituation alt_expectation=PrintSituation::APPEND, int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
|
void | printSection (int list_indent=-1, int nested_list_indent=-1, ListEnumeration list_numbering=ListEnumeration::NONE, ListEnumeration nested_list_numbering=ListEnumeration::NONE) const |
|
|
void | setSectionDetails (int section_id_in) |
| Set the section identifier (and, optionally, the numbering style).
|
|
void | setSectionDetails (ListEnumeration section_marking_in) |
|
void | setSectionDetails (int section_id_in, ListEnumeration section_marking_in) |
|
|
void | addNarration (const std::string &narration_in) |
| Add a block of narrative to the section.
|
|
void | addNarration (const TextFile &narration_in, TextEnds line_endings=TextEnds::AS_IS) |
|
|
void | addScript (const std::string &script_in) |
| Add new commands to the section as script, unprotected by comment characters.
|
|
void | addScript (const TextFile &script_in, TextEnds line_endings=TextEnds::AS_IS) |
|
Any output file is expected to break into sections, which should be numbered in order and formatted consistently. This object will collect the elements of a section and provide methods for automatically writing them to an arbitrary output file.