ampsci
High-precision calculations for one- and two-valence atomic systems
IO Namespace Reference

In-out (timers, profilers, and read/write data) More...

Namespaces

namespace  FRW
 

Classes

class  InputBlock
 Holds list of Options, and a list of other InputBlocks. Can be initialised with a list of options, with a string, or from a file (ifstream). Format for input is, e.g.,: More...
 
struct  IsVector
 Class to determine if a class template in vector. More...
 
struct  Option
 Simple struct; holds key-value pair, both strings. == compares key. More...
 

Functions

std::string removeSpaces (std::string str)
 Removes all white space (space, tab, newline), except for those in quotes.
 
std::string removeQuoteMarks (std::string str)
 Removes all quote marks.
 
void removeBlockComments (std::string &input)
 Removes all c++ style block comments from a string.
 
std::string removeComments (const std::string &input)
 Removes all c++ style comments from a string (block and line)
 
std::string expandIncludes (std::string input)
 Expands "#include" files.
 
template<typename T >
parse_str_to_T (const std::string &value_as_str)
 Parses a string to type T by stringstream.
 
std::string file_to_string (const std::istream &file)
 Parses entire file into string. Note: v. inefficient.
 
void print_line (const char c=' *', const int num=80)
 Prints a line of 'c' characters (dflt '*'), num chars long (dflt 80) to cout.
 
std::string time_date ()
 
std::string date ()
 
std::string time ()
 
bool operator== (InputBlock block, std::string_view name)
 
bool operator== (std::string_view name, InputBlock block)
 
bool operator!= (InputBlock block, std::string_view name)
 
bool operator!= (std::string_view name, InputBlock block)
 

Detailed Description

In-out (timers, profilers, and read/write data)

Function Documentation

◆ removeSpaces()

std::string IO::removeSpaces ( std::string  str)
inline

Removes all white space (space, tab, newline), except for those in quotes.

◆ removeQuoteMarks()

std::string IO::removeQuoteMarks ( std::string  str)
inline

Removes all quote marks.

◆ removeBlockComments()

void IO::removeBlockComments ( std::string &  input)
inline

Removes all c++ style block comments from a string.

◆ removeComments()

std::string IO::removeComments ( const std::string &  input)
inline

Removes all c++ style comments from a string (block and line)

◆ expandIncludes()

std::string IO::expandIncludes ( std::string  input)
inline

Expands "#include" files.

◆ parse_str_to_T()

template<typename T >
T IO::parse_str_to_T ( const std::string &  value_as_str)
inline

Parses a string to type T by stringstream.

◆ file_to_string()

std::string IO::file_to_string ( const std::istream &  file)
inline

Parses entire file into string. Note: v. inefficient.

◆ print_line()

void IO::print_line ( const char  c = '*',
const int  num = 80 
)
inline

Prints a line of 'c' characters (dflt '*'), num chars long (dflt 80) to cout.