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)
25template<
typename T,
typename... Ts>
26void do_fmt(std::ostringstream& oss, std::string_view format,
const T& val,
const Ts&... rest)
30 while(i < format.size())
32 if(format[i] ==
'{' && (format.size() > (i + 1)) && format.at(i + 1) ==
'}')
35 return do_fmt(oss, format.substr(i + 2), rest...);
59template<
typename...
T>
60std::string
fmt(std::string_view format,
const T&... args)
62 std::ostringstream oss;
63 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)