Public Member Functions | Private Attributes | List of all members
oomph::DocInfo Class Reference

Information for documentation of results: Directory and file number to enable output in the form RESLT/filename11.dat, say. Documentation can be switched on and off. More...

#include <oomph_utilities.h>

Public Member Functions

 DocInfo ()
 Constructor. Default settings: Current directory, step ‘0’, label="", full documentation enabled and output directory is required to exist when set_directory() is called.
 
 DocInfo (const std::string &directory)
 Constructor with specific directory.
 
std::string directory () const
 Output directory.
 
void set_directory (const std::string &directory)
 Set output directory (we try to open a file in it to see if the directory exists – if it doesn't we'll issue a warning – or, if directory_must_exist()==true, throw and OomphLibError.
 
void enable_doc ()
 Enable documentation.
 
void disable_doc ()
 Disable documentation.
 
bool is_doc_enabled () const
 Are we documenting?
 
unsignednumber ()
 Number used (e.g.) for labeling output files.
 
unsigned number () const
 Number used (e.g.) for labeling output files. Const version.
 
std::string number_as_string () const
 Get number as a string (useful to completely avoid C-strings).
 
std::string & label ()
 String used (e.g.) for labeling output files.
 
std::string label () const
 String used (e.g.) for labeling output files. Const version.
 
void enable_error_if_directory_does_not_exist ()
 Call to throw an error if directory does not exist.
 
void disable_error_if_directory_does_not_exist ()
 Call to issue a warning if the directory does not exists.
 

Private Attributes

std::string Directory
 Directory name.
 
bool Doc_flag
 Doc or don't?
 
unsigned Number
 Number to label output file, say.
 
std::string Label
 String to label output file, say.
 
bool Directory_must_exist
 Boolean flag to decide response if an output directory doesn't exist: If true, we terminate code execution by throwing an OomphLibError rather than just issuing a warning.
 

Detailed Description

Information for documentation of results: Directory and file number to enable output in the form RESLT/filename11.dat, say. Documentation can be switched on and off.

Definition at line 508 of file oomph_utilities.h.

Constructor & Destructor Documentation

◆ DocInfo() [1/2]

oomph::DocInfo::DocInfo ( )
inline

Constructor. Default settings: Current directory, step ‘0’, label="", full documentation enabled and output directory is required to exist when set_directory() is called.

Definition at line 514 of file oomph_utilities.h.

◆ DocInfo() [2/2]

oomph::DocInfo::DocInfo ( const std::string &  directory)
inline

Constructor with specific directory.

Definition at line 524 of file oomph_utilities.h.

Member Function Documentation

◆ directory()

std::string oomph::DocInfo::directory ( ) const
inline

◆ disable_doc()

void oomph::DocInfo::disable_doc ( )
inline

◆ disable_error_if_directory_does_not_exist()

void oomph::DocInfo::disable_error_if_directory_does_not_exist ( )
inline

Call to issue a warning if the directory does not exists.

Definition at line 600 of file oomph_utilities.h.

References Directory_must_exist.

◆ enable_doc()

void oomph::DocInfo::enable_doc ( )
inline

Enable documentation.

Definition at line 546 of file oomph_utilities.h.

References Doc_flag.

◆ enable_error_if_directory_does_not_exist()

void oomph::DocInfo::enable_error_if_directory_does_not_exist ( )
inline

Call to throw an error if directory does not exist.

Definition at line 594 of file oomph_utilities.h.

References Directory_must_exist.

◆ is_doc_enabled()

bool oomph::DocInfo::is_doc_enabled ( ) const
inline

◆ label() [1/2]

std::string & oomph::DocInfo::label ( )
inline

◆ label() [2/2]

std::string oomph::DocInfo::label ( ) const
inline

String used (e.g.) for labeling output files. Const version.

Definition at line 588 of file oomph_utilities.h.

References Label.

◆ number() [1/2]

unsigned & oomph::DocInfo::number ( )
inline

◆ number() [2/2]

unsigned oomph::DocInfo::number ( ) const
inline

Number used (e.g.) for labeling output files. Const version.

Definition at line 570 of file oomph_utilities.h.

References Number.

◆ number_as_string()

std::string oomph::DocInfo::number_as_string ( ) const
inline

Get number as a string (useful to completely avoid C-strings).

Definition at line 576 of file oomph_utilities.h.

References Number, and oomph::StringConversion::to_string().

◆ set_directory()

void oomph::DocInfo::set_directory ( const std::string &  directory)

Set output directory (we try to open a file in it to see if the directory exists – if it doesn't we'll issue a warning – or, if directory_must_exist()==true, throw and OomphLibError.

Set output directory (we try to open a file in it to see if the directory exists – if it doesn't we'll issue a warning – or, if directory_must_exist()==true, die by throwing and OomphLibError.

Definition at line 306 of file oomph_utilities.cc.

References Directory, and Directory_must_exist.

Member Data Documentation

◆ Directory

std::string oomph::DocInfo::Directory
private

Directory name.

Definition at line 607 of file oomph_utilities.h.

Referenced by directory(), and set_directory().

◆ Directory_must_exist

bool oomph::DocInfo::Directory_must_exist
private

Boolean flag to decide response if an output directory doesn't exist: If true, we terminate code execution by throwing an OomphLibError rather than just issuing a warning.

Definition at line 622 of file oomph_utilities.h.

Referenced by disable_error_if_directory_does_not_exist(), enable_error_if_directory_does_not_exist(), and set_directory().

◆ Doc_flag

bool oomph::DocInfo::Doc_flag
private

Doc or don't?

Definition at line 610 of file oomph_utilities.h.

Referenced by disable_doc(), enable_doc(), and is_doc_enabled().

◆ Label

std::string oomph::DocInfo::Label
private

String to label output file, say.

Definition at line 616 of file oomph_utilities.h.

Referenced by label(), and label().

◆ Number

unsigned oomph::DocInfo::Number
private

Number to label output file, say.

Definition at line 613 of file oomph_utilities.h.

Referenced by number(), number(), and number_as_string().


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