Go to the source code of this file.
Classes | |
struct | nix::Magenta< T > |
struct | nix::Uncolored< T > |
class | nix::HintFmt |
Functions | |
template<class F> | |
void | nix::formatHelper (F &f) |
template<class F, typename T, typename... Args> | |
void | nix::formatHelper (F &f, const T &x, const Args &... args) |
void | nix::setExceptions (boost::format &fmt) |
std::string | nix::fmt (const std::string &s) |
std::string | nix::fmt (std::string_view s) |
std::string | nix::fmt (const char *s) |
template<typename... Args> | |
std::string | nix::fmt (const std::string &fs, const Args &... args) |
template<class T> | |
std::ostream & | nix::operator<< (std::ostream &out, const Magenta< T > &y) |
template<class T> | |
std::ostream & | nix::operator<< (std::ostream &out, const Uncolored< T > &y) |
std::ostream & | nix::operator<< (std::ostream &os, const HintFmt &hf) |
|
inline |
A helper for writing a boost::format
expression to a string.
These are (roughly) equivalent:
However, when called with a single argument, the string is returned unchanged.
If you write code like this:
And stringFromUserInput
contains formatting placeholders like s
, then the code will crash at runtime. fmt
helps you avoid this pitfall.
|
inline |
A helper for writing boost::format
expressions.
These are equivalent:
With a single argument, formatHelper(s)
is a no-op.
|
inline |
Set the correct exceptions for fmt
.