|
Manticore
Version 1.0
Physics of Molecular Clouds
|
MathUtils package. More...
Classes | |
| class | CommandLine |
| Command line options and arguments. More... | |
| class | Exception |
| MathUtils exception (base) class. More... | |
| struct | Log |
| Logging facility. More... | |
Functions | |
| const char * | Cform (const std::string &s) |
| Converts input to well-defined type for stdio. More... | |
| template<typename T > | |
| T * | Cform (T *p) |
| Converts input to well-defined type for stdio. More... | |
| double | Cform (double i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned long long i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned long i) |
| Converts input to well-defined type for stdio. More... | |
| unsigned long | Cform (unsigned i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (long long i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (long i) |
| Converts input to well-defined type for stdio. More... | |
| long | Cform (int i) |
| Converts input to well-defined type for stdio. More... | |
| int | Cform (unsigned char i) |
| Converts input to well-defined type for stdio. More... | |
| int | Cform (char i) |
| Converts input to well-defined type for stdio. More... | |
| int | cxxfclose (FILE *fp) |
| Standardized fclose(). More... | |
| FILE * | cxxfopen (const std::string &file, const char *mode) |
| Standardized fopen(). More... | |
| template<typename... Args> | |
| int | cxxfprintf (FILE *f, Args &&... args) |
| C fprintf() with type conversion (not safety). More... | |
| template<typename... Args> | |
| int | cxxprintf (Args &&... args) |
| C printf() with type conversion (not safety). More... | |
| template<typename... Args> | |
| int | cxxsnprintf (char *buf, size_t len, Args &&... args) |
| C snprintf() with type conversion (not safety). More... | |
| void | exitException (std::exception &ex, int status=EXIT_FAILURE) |
| Exits program with exception message. Exits the program (with status) after displaying the exception ex. More... | |
| const std::string | nullStr (1, 0) |
| void | printException (std::exception &ex) |
| Prints exception message. More... | |
| const std::string | siPrefixes ("YZEPTGMkhDdcmunpfazy") |
Variables | |
| std::string::size_type | npos = std::string::npos |
| const std::map< char, const char * > | siScaleMap |
MathUtils package.
|
inline |
Converts input to well-defined type for stdio.
Definition at line 222 of file Log.h.
Referenced by cxxfprintf(), cxxprintf(), and cxxsnprintf().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Standardized fclose().
Equivalent to <cstdio> fclose(), except that the call is ignored if fp is stdin, stdout or stderr.
| [in] | fp | File stream pointer. |
Definition at line 325 of file Log.h.
Referenced by mutils::Log::setStream().
|
inline |
Standardized fopen().
Equivalent to <cstdio> fopen(), except:
"-" and "!" are interpreted as stdin/stdout and stderr, respectively.| [in] | file | File name. |
| [in] | mode | File mode. |
Definition at line 311 of file Log.h.
Referenced by mutils::Log::setStream().
|
inline |
C fprintf() with type conversion (not safety).
| [in] | f | Open output file stream. |
| [in] | args | Input arguments (beginning with format string). |
Definition at line 284 of file Log.h.
References Cform().
Referenced by mutils::Log::message().
|
inline |
C printf() with type conversion (not safety).
Wraps each argument in a Cform() call and passes them to printf(). This converts all signed integers to type long and all unsigned integers to type unsigned long, so that the format conversion applied to them must be %ld or %lu, respectively. Characters are converted to type int and hence should use either %c or %d. Both C-strings and C++ std::string can be given as arguments using the %s conversion. All the usual format qualifiers may also be used.
| [in] | args | Input arguments (beginning with format string). |
Definition at line 273 of file Log.h.
References Cform().
|
inline |
C snprintf() with type conversion (not safety).
| [in] | buf | Output buffer. |
| [in] | len | Buffer length. |
| [in] | args | Input arguments (beginning with format string). |
Definition at line 297 of file Log.h.
References Cform().
|
inline |
Exits program with exception message. Exits the program (with status) after displaying the exception ex.
| [in] | ex | Input exception. |
| [in] | status | Exit status. |
Definition at line 208 of file Exception.h.
References mutils::Log::file, and printException().
| const std::string mutils::nullStr | ( | 1 | , |
| 0 | |||
| ) |
|
inline |
Prints exception message.
If ex is an mutils::Exception, calls mutils::Exception::print(); otherwise, prints ex.what() (to stderr).
| [in] | ex | Input exception. |
Definition at line 194 of file Exception.h.
References mutils::Exception::print().
Referenced by exitException().
| const std::string mutils::siPrefixes | ( | "YZEPTGMkhDdcmunpfazy" | ) |
| Prefix | Name | Value | Prefix | Name | Value | |
|---|---|---|---|---|---|---|
| Y | yotta | 1024 | y | yocto | 10-24 | |
| Z | zetta | 1021 | z | zepto | 10-21 | |
| E | exa | 1018 | a | atto | 10-18 | |
| P | peta | 1015 | f | femto | 10-15 | |
| T | tera | 1012 | p | pico | 10-12 | |
| G | giga | 109 | n | nano | 10-9 | |
| M | mega | 106 | u | micro | 10-6 | |
| k | kilo | 103 | m | milli | 10-3 | |
| h | hetco | 102 | c | centi | 10-2 | |
| D | deka | 101 | d | deci | 10-1 |
| std::string::size_type mutils::npos = std::string::npos |
Definition at line 24 of file statics.cc.
Referenced by mutils::CommandLine::Option::keyword(), and mutils::CommandLine::usage().
| const std::map<char, const char *> mutils::siScaleMap |
Definition at line 45 of file statics.cc.
1.8.14