Tomographer
v5.4
Tomographer C++ Framework Documentation
|
Utilities for formatting strings. More...
#include <cstdio>
#include <cstdarg>
#include <chrono>
#include <string>
#include <sstream>
#include <iostream>
#include <utility>
#include <vector>
#include <iomanip>
#include <functional>
#include <tomographer/tools/cxxutil.h>
Go to the source code of this file.
Classes | |
class | Tomographer::Tools::BadFmtsFormat |
Exception for bad printf format. More... | |
struct | Tomographer::Tools::hasOStreamOp< T > |
Traits class to see whether an object exposes a "<<" operator overload for std::ostream. More... | |
class | Tomographer::Tools::ConsoleFormatterHelper |
Minimal tool for formatting console stuff with fixed line width. More... | |
class | Tomographer::Tools::SimpleWordWrapper |
class | Tomographer::Tools::FmtFootnotes |
Helper to format footnotes in Fmt. More... | |
Namespaces | |
Tomographer | |
Base namespace for the Tomographer project. | |
Tomographer::Tools | |
Various useful tools. | |
Macros | |
#define | streamstr(tokens) |
Utility macro to format stream tokens to a std::string . More... | |
#define | streamcstr(tokens) streamstr(tokens).c_str() |
Utility macro to format stream tokens to a C string. More... | |
Functions | |
std::string | Tomographer::Tools::vfmts (const char *fmt, va_list vl) |
printf- formatting to a std::string , with va_list pointer More... | |
std::string | Tomographer::Tools::fmts (const char *fmt,...) |
printf- format to a std::string More... | |
template<typename T > | |
_Unspecified | Tomographer::Tools::streamIfPossible (const T &obj) |
Utility to stream an object, but only if "<<" overload exists. More... | |
template<typename T > | |
_Unspecified | Tomographer::Tools::streamIfPossible (const T &obj, std::string before, std::string after=std::string(), std::string alternative="<"+std::string(typeid(T).name())+">") |
A slightly more sophisticated alternative to streamIfPossible() More... | |
std::string | Tomographer::Tools::fmtDuration (double seconds) |
Format a number of seconds into a human-readable string. More... | |
template<typename Rep , typename Period > | |
std::string | Tomographer::Tools::fmtDuration (std::chrono::duration< Rep, Period > dt) |
Format a std::chrono::duration into a human-readable string. More... | |
std::ostream & | Tomographer::Tools::operator<< (std::ostream &stream, const FmtFootnotes &f) |
Utilities for formatting strings.
Definition in file fmt.h.
#define streamcstr | ( | tokens | ) | streamstr(tokens).c_str() |
#define streamstr | ( | tokens | ) |
Utility macro to format stream tokens to a std::string
.
Usage example:
This is typically useful if you want to feed in C++ objects to a printf()-like function.