Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Implementation for printf-style formatting, based on boost::format.
This file holds the generic implementation of our format frontend, which actually just invokes boost::format. The corresponding header format-string.hpp provides some template functions and classes, either invoking a custom string conversion, or passing primitive values down unaltered.
Here, we define explicit specialisations for the frontend to invoke, which in turn just pass on the given argument value to the embedded boost::format object, which in turn dumps the formatted result into an embedded string stream.
To avoid exposing boost::format in the frontend header, we use an opaque buffer of appropriate size to piggyback the formatter object.
Definition in file format-string.cpp.
#include "lib/error.hpp"
#include "lib/format-util.hpp"
#include "lib/format-string.hpp"
#include <boost/static_assert.hpp>
#include <boost/format.hpp>
#include <iostream>
#include <cstddef>
#include <new>
Functions | |
boost::format & | accessImpl (std::byte *buffer) |
void | destroyImpl (std::byte *buffer) |
LUMIERA_ERROR_DEFINE (FORMAT_SYNTAX, "Syntax error in format string for boost::format") | |
std::ostream & | operator<< (std::ostream &os, _Fmt const &fmt) |
send the formatted buffer directly to the output stream. More... | |
void | pushFailsafeReplacement (std::byte *formatter, const char *errorMsg=NULL) |
in case the formatting of a (primitive) value fails, we try to supply an error indicator instead | |
void | suppressInsufficientArgumentErrors (std::byte *formatter) |
Namespaces |
std::ostream& util::operator<< | ( | std::ostream & | os, |
_Fmt const & | fmt | ||
) |
send the formatted buffer directly to the output stream.
Definition at line 248 of file format-string.cpp.