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. More...
 
 DocInfo (const std::string &directory)
 Constructor with specific directory. More...
 
std::string directory () const
 Output directory. More...
 
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. More...
 
void enable_doc ()
 Enable documentation. More...
 
void disable_doc ()
 Disable documentation. More...
 
bool is_doc_enabled () const
 Are we documenting? More...
 
unsigned & number ()
 Number used (e.g.) for labeling output files. More...
 
unsigned number () const
 Number used (e.g.) for labeling output files. Const version. More...
 
std::string number_as_string () const
 Get number as a string (useful to completely avoid C-strings). More...
 
std::string & label ()
 String used (e.g.) for labeling output files. More...
 
std::string label () const
 String used (e.g.) for labeling output files. Const version. More...
 
void enable_error_if_directory_does_not_exist ()
 Call to throw an error if directory does not exist. More...
 
void disable_error_if_directory_does_not_exist ()
 Call to issue a warning if the directory does not exists. More...
 

Private Attributes

std::string Directory
 Directory name. More...
 
bool Doc_flag
 Doc or don't? More...
 
unsigned Number
 Number to label output file, say. More...
 
std::string Label
 String to label output file, say. More...
 
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. More...
 

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 498 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 504 of file oomph_utilities.h.

◆ DocInfo() [2/2]

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

Constructor with specific directory.

Definition at line 514 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 590 of file oomph_utilities.h.

References Directory_must_exist.

◆ enable_doc()

void oomph::DocInfo::enable_doc ( )
inline

Enable documentation.

Definition at line 536 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 584 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 578 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 560 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 566 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 298 of file oomph_utilities.cc.

References Directory, Directory_must_exist, and oomph::Global_string_for_annotation::string().

Member Data Documentation

◆ Directory

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

Directory name.

Definition at line 597 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 612 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 600 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 606 of file oomph_utilities.h.

Referenced by label().

◆ Number

unsigned oomph::DocInfo::Number
private

Number to label output file, say.

Definition at line 603 of file oomph_utilities.h.

Referenced by number(), and number_as_string().


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