PSCF v1.1
|
Miscellaneous utility classes and functions. More...
Classes | |
class | Util::Bit |
Represents a specific bit location within an unsigned int. More... | |
class | Util::Exception |
A user-defined exception. More... | |
class | Util::FileMaster |
A FileMaster manages input and output files for a simulation. More... | |
class | Util::FlagSet |
A set of boolean variables represented by characters. More... | |
class | Util::Log |
A static class that holds a log output stream. More... | |
class | Util::Memory |
Provides method to allocate array. More... | |
class | Util::Notifier< Event > |
Abstract template for a notifier (or subject) in the Observer design pattern. More... | |
class | Util::Observer< Event > |
Abstract class template for observer in the observer design pattern. More... | |
class | Util::Setable< T > |
Template for a value that can be set or declared null (i.e., unknown). More... | |
class | Util::Timer |
Wall clock timer. More... | |
Functions | |
std::string | Util::toString (int n) |
Return string representation of an integer. More... | |
int | Util::rStrip (std::string &string) |
Strip trailing whitespace from a string. More... | |
void | Util::checkString (std::istream &in, const std::string &expected) |
Extract string from stream, and compare to expected value. More... | |
bool | Util::getLine (std::istream &in, std::stringstream &line) |
Read the next line into a stringstream. More... | |
bool | Util::getNextLine (std::istream &in, std::string &line) |
Read the next non-empty line into a string, strip trailing whitespace. More... | |
bool | Util::getNextLine (std::istream &in, std::stringstream &line) |
Read next non-empty line into a stringstream, strip trailing whitespace. More... | |
template<typename D , typename B , typename M > | |
ptrdiff_t | Util::memberOffset (D &object, M B::*memPtr) |
Template for calculating offsets of data members. More... | |
Miscellaneous utility classes and functions.
std::string Util::toString | ( | int | n | ) |
Return string representation of an integer.
n | integer to be converted. |
Definition at line 52 of file ioUtil.cpp.
Referenced by Pscf::Fd1d::Sweep::getSolution(), Pscf::Fd1d::System::writeQAll(), Pscf::Pspc::System< D >::writeQAll(), and Pscf::Pspg::System< D >::writeQAll().
int Util::rStrip | ( | std::string & | string | ) |
Strip trailing whitespace from a string.
string | string (stripped upon return). |
Definition at line 18 of file ioUtil.cpp.
Referenced by Util::getNextLine(), and Util::XmlAttribute::match().
void Util::checkString | ( | std::istream & | in, |
const std::string & | expected | ||
) |
Extract string from stream, and compare to expected value.
Exception | if input value differs from expected value. |
in | input stream |
expected | expected value of string read from stream |
Definition at line 37 of file ioUtil.cpp.
References Util::Log::file(), and UTIL_THROW.
bool Util::getLine | ( | std::istream & | in, |
std::stringstream & | line | ||
) |
Read the next line into a stringstream.
Variant of std::getline(). Does not strip trailing whitespace.
in | input stream from which to read. |
line | stringstream containing line, on output. |
Definition at line 62 of file ioUtil.cpp.
bool Util::getNextLine | ( | std::istream & | in, |
std::string & | line | ||
) |
Read the next non-empty line into a string, strip trailing whitespace.
Variant of std::getline() that skips empty lines.
in | input stream from which to read. |
line | string with next non-empty line, on output. |
Definition at line 79 of file ioUtil.cpp.
References Util::rStrip().
bool Util::getNextLine | ( | std::istream & | in, |
std::stringstream & | line | ||
) |
Read next non-empty line into a stringstream, strip trailing whitespace.
Variant of std::getline() that skips empty lines and uses stringstream.
in | input stream from which to read. |
line | stringstream containing next non-empty line, on output. |
Definition at line 100 of file ioUtil.cpp.
References Util::rStrip().