7#ifndef BOTAN_UTIL_FMT_H_
8#define BOTAN_UTIL_FMT_H_
10#include <botan/types.h>
20inline void do_fmt(std::ostringstream& oss, std::string_view format) {
24template <
typename T,
typename... Ts>
25void do_fmt(std::ostringstream& oss, std::string_view format,
const T& val,
const Ts&... rest) {
28 while(i < format.size()) {
29 if(format[i] ==
'{' && (format.size() > (i + 1)) && format.at(i + 1) ==
'}') {
31 return do_fmt(oss, format.substr(i + 2), rest...);
52template <
typename...
T>
53std::string
fmt(std::string_view format,
const T&... args) {
54 std::ostringstream oss;
55 oss.imbue(std::locale::classic());
void do_fmt(std::ostringstream &oss, std::string_view format)
std::string fmt(std::string_view format, const T &... args)