|
Nix 2.93.3
Lix: A modern, delicious implementation of the Nix package manager; unstable internal interfaces
|
#include <iostream>#include <string>#include <boost/format.hpp>#include "lix/libutil/ansicolor.hh"Go to the source code of this file.
Classes | |
| struct | nix::Magenta< T > |
| struct | nix::Uncolored< T > |
| struct | nix::fmt_internal::HintFmt |
| class | nix::HintFmt |
Functions | |
| std::string | nix::getStackTrace () |
| 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) |
| void | nix::fmt_internal::setExceptions (boost::format &fmt) |
| std::string | nix::fmt (const std::string &s) |
| std::string | nix::fmt (const char *s) |
| template<typename... Args> | |
| std::string | nix::fmt (const std::string &fs, const Args &... args) |
| 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.
| std::string nix::getStackTrace | ( | ) |
Gets a C++ stack trace using boost stacktrace
|
inline |
Set the correct exceptions for fmt.