Documentation

This utility class is used to print only on node 0 and to provide attractive indentation of output.

This class only has static functions, hence there is no need to create objects of this type.

this is an old way to write singleton

Classes

class  indentbuf
 auto-indenting streambuf More...
 
class  streambuf_restorer
 

Static Public Member Functions

template<typename C = char>
static std::basic_ios< C > & indent (std::basic_ios< C > &o)
 
template<typename C = char>
static std::basic_ios< C > & decindent (std::basic_ios< C > &o)
 
template<typename C = char>
static std::basic_ios< C > & incindent (std::basic_ios< C > &o)
 
template<typename C = char>
static std::basic_ios< C > & skipnextindent (std::basic_ios< C > &o)
 
template<typename C = char>
static void setverbose (std::basic_ios< C > &o, long n)
 
template<typename C = char>
static long getverbose (std::basic_ios< C > &o)
 
template<typename C = char>
static void setindent (std::basic_ios< C > &o, long n)
 
template<typename C = char>
static long getindent (std::basic_ios< C > &o)
 
static int set_printnode (int)
 
static int get_printnode ()
 
static void set_debug (int)
 
static int get_debug ()
 
static void init_mp (int me)
 
static int get_node ()
 
static void set_default_basename (std::string)
 set the default base name for temporary files More...
 
static const std::string & default_basename ()
 
static void set_default_work_dir (std::string)
 set the default work directory for POSIX I/O of large files. More...
 
static const std::string & default_work_dir ()
 
static void set_default_file_prefix (std::string)
 set the prefix to prepend to relative file names More...
 
static const std::string & default_file_prefix ()
 
static std::string fileext_to_filename (const std::string &extension)
 
static std::string fileext_to_fullpathname (const std::string &extension)
 
template<typename C = char>
static void autoindent_ostream (std::basic_ostream< C > &o)
 
template<typename C = char>
static void deautoindent_ostream (std::basic_ostream< C > &o)
 
template<typename Char >
static std::basic_ostream< Char > & license (std::basic_ostream< Char > &o)
 
template<typename Char >
static std::basic_ostream< Char > & warranty (std::basic_ostream< Char > &o)
 
template<typename Char >
static std::basic_ostream< Char > & copyright (std::basic_ostream< Char > &o)
 
static void initialize ()
 Initializes the FormIO. More...
 
static void finalize ()
 Finalizes the FormIO. More...
 

Friends

class indentbuf< char >
 
class indentbuf< wchar_t >
 

Member Function Documentation

◆ autoindent_ostream()

template<typename C >
void mpqc::FormIO::autoindent_ostream ( std::basic_ostream< C > &  o)
static

makes ostream @os autoindenting

Warning
os must outlast FormIO ; hence for nonstandard ostreams call deautoindent_ostream before destroying it

◆ copyright()

template<typename Char >
std::basic_ostream< Char > & mpqc::FormIO::copyright ( std::basic_ostream< Char > &  o)
static

◆ deautoindent_ostream()

template<typename C >
void mpqc::FormIO::deautoindent_ostream ( std::basic_ostream< C > &  o)
static

disables autoindentation in os

Note
it is safe to delete os after calling this

◆ decindent()

template<typename C >
std::basic_ios< C > & mpqc::FormIO::decindent ( std::basic_ios< C > &  o)
static

◆ default_basename()

const std::string & FormIO::default_basename ( )
static
Returns
the default base name for temporary files; if set_default_basename had not been called returns "mpqc"

◆ default_file_prefix()

const std::string & FormIO::default_file_prefix ( )
static
Returns
the the prefix to prepend to relative file names; if set_default_file_prefix had not been called returns "."

◆ default_work_dir()

const std::string & FormIO::default_work_dir ( )
static
Returns
the default work directory for POSIX I/O of large files; if set_default_work_dir had not been called returns "."

◆ fileext_to_filename()

std::string FormIO::fileext_to_filename ( const std::string &  extension)
static
Parameters
[in]extensionfilename extension, e.g. ".txt"
Returns
the file name obtained by concatenating basename with extension

◆ fileext_to_fullpathname()

std::string FormIO::fileext_to_fullpathname ( const std::string &  extension)
static

same as FormIO::fileext_to_filename but uses full path

Returns
the file name obtained by concatenating work_dir, basename, and extension

◆ finalize()

void FormIO::finalize ( )
static

Finalizes the FormIO.

To be called before exiting the program

Note
resets auto-indentation on all streams that were autoindented by FormIO

◆ get_debug()

int FormIO::get_debug ( )
static

◆ get_node()

int FormIO::get_node ( )
static

◆ get_printnode()

int FormIO::get_printnode ( )
static

◆ getindent()

template<typename C >
long mpqc::FormIO::getindent ( std::basic_ios< C > &  o)
static

◆ getverbose()

template<typename C >
long mpqc::FormIO::getverbose ( std::basic_ios< C > &  o)
static

◆ incindent()

template<typename C >
std::basic_ios< C > & mpqc::FormIO::incindent ( std::basic_ios< C > &  o)
static

◆ indent()

template<typename C >
std::basic_ios< C > & mpqc::FormIO::indent ( std::basic_ios< C > &  o)
static

◆ init_mp()

void FormIO::init_mp ( int  me)
static

◆ initialize()

void FormIO::initialize ( )
static

Initializes the FormIO.

There should be no need to initialize FormIO since it will be auto-initialized on its first use.

Note
calls autoindent_ostream on every std iostream (char- and wchar_t-based)

◆ license()

template<typename Char >
std::basic_ostream< Char > & mpqc::FormIO::license ( std::basic_ostream< Char > &  o)
static

◆ set_debug()

void FormIO::set_debug ( int  n)
static

◆ set_default_basename()

void FormIO::set_default_basename ( std::string  basename)
static

set the default base name for temporary files

◆ set_default_file_prefix()

void FormIO::set_default_file_prefix ( std::string  prefix)
static

set the prefix to prepend to relative file names

◆ set_default_work_dir()

void FormIO::set_default_work_dir ( std::string  work_dir)
static

set the default work directory for POSIX I/O of large files.

◆ set_printnode()

int FormIO::set_printnode ( int  n)
static

◆ setindent()

template<typename C >
void mpqc::FormIO::setindent ( std::basic_ios< C > &  o,
long  n 
)
static

◆ setverbose()

template<typename C >
void mpqc::FormIO::setverbose ( std::basic_ios< C > &  o,
long  n 
)
static

◆ skipnextindent()

template<typename C >
std::basic_ios< C > & mpqc::FormIO::skipnextindent ( std::basic_ios< C > &  o)
static

◆ warranty()

template<typename Char >
std::basic_ostream< Char > & mpqc::FormIO::warranty ( std::basic_ostream< Char > &  o)
static

Friends And Related Function Documentation

◆ indentbuf< char >

friend class indentbuf< char >
friend

◆ indentbuf< wchar_t >

friend class indentbuf< wchar_t >
friend

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