Nix 2.36.0
Nix, the purely functional package manager; unstable internal interfaces
Loading...
Searching...
No Matches
nix::HintFmt Class Reference

#include <fmt.hh>

Public Member Functions

 HintFmt (const std::string &literal)
template<typename... Args>
 HintFmt (const std::string &format, const Args &... args)
 HintFmt (const HintFmt &hf)
template<typename... Args>
 HintFmt (boost::format &&fmt, const Args &... args)
HintFmt & operator% (const std::filesystem::path &value)=delete
template<class T>
HintFmt & operator% (const T &value)
template<class T>
HintFmt & operator% (const Uncolored< T > &value)
HintFmt & operator% (const HintFmt &value)
HintFmt & operator= (const HintFmt &rhs)=default
std::string str () const
template<>
HintFmt & operator% (const ValuePrinter &value)
template<>
HintFmt & operator% (const ValuePrinter &value)

Static Public Member Functions

static HintFmt fromFormatString (const std::string &format)

Detailed Description

A wrapper around boost::format which colors interpolated arguments in magenta by default.

Constructor & Destructor Documentation

◆ HintFmt() [1/2]

nix::HintFmt::HintFmt ( const std::string & literal)
inline

Format the given string literally, without interpolating format placeholders.

◆ HintFmt() [2/2]

template<typename... Args>
nix::HintFmt::HintFmt ( const std::string & format,
const Args &... args )
inline

Interpolate the given arguments into the format string.

Member Function Documentation

◆ operator%() [1/2]

HintFmt & nix::HintFmt::operator% ( const HintFmt & value)
inline

Embed another hint as is. It carries its own coloring.

◆ operator%() [2/2]

template<>
HintFmt & nix::HintFmt::operator% ( const ValuePrinter & value)

ValuePrinter does its own ANSI formatting, so we don't color it magenta.


The documentation for this class was generated from the following files:
  • libutil/include/nix/util/fmt.hh
  • libexpr/include/nix/expr/print.hh
  • libexpr/print.cc