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 not 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
 

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

Constructor & Destructor Documentation

oomph::DocInfo::DocInfo ( )
inline

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

Definition at line 523 of file oomph_utilities.h.

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

Constructor with specific directory.

Definition at line 528 of file oomph_utilities.h.

Member Function Documentation

std::string oomph::DocInfo::directory ( ) const
inline
void oomph::DocInfo::disable_doc ( )
inline
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 573 of file oomph_utilities.h.

void oomph::DocInfo::enable_doc ( )
inline

Enable documentation.

Definition at line 543 of file oomph_utilities.h.

void oomph::DocInfo::enable_error_if_directory_does_not_exist ( )
inline

Call to throw an error if directory does not exist.

Definition at line 570 of file oomph_utilities.h.

bool oomph::DocInfo::is_doc_enabled ( ) const
inline
std::string& oomph::DocInfo::label ( )
inline
std::string oomph::DocInfo::label ( ) const
inline

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

Definition at line 567 of file oomph_utilities.h.

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

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

Definition at line 555 of file oomph_utilities.h.

References oomph::Global_unsigned::Number.

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

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

Definition at line 558 of file oomph_utilities.h.

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

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 527 of file oomph_utilities.cc.

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

Member Data Documentation

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

Directory name.

Definition at line 578 of file oomph_utilities.h.

Referenced by set_directory().

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

Referenced by set_directory().

bool oomph::DocInfo::Doc_flag
private

Doc or don't?

Definition at line 581 of file oomph_utilities.h.

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

String to label output file, say.

Definition at line 587 of file oomph_utilities.h.

unsigned oomph::DocInfo::Number
private

Number to label output file, say.

Definition at line 584 of file oomph_utilities.h.


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