CppCommon  1.0.4.1
C++ Common Library
format.h
Go to the documentation of this file.
1 
9 #ifndef CPPCOMMON_STRING_FORMAT_H
10 #define CPPCOMMON_STRING_FORMAT_H
11 
12 #if defined(__clang__)
13 #pragma clang system_header
14 #elif defined(__GNUC__)
15 #pragma GCC system_header
16 #elif defined(_MSC_VER)
17 #pragma system_header
18 #endif
19 
20 #include <fmt/args.h>
21 #include <fmt/format.h>
22 #include <fmt/ostream.h>
23 #include <fmt/xchar.h>
24 
25 namespace CppCommon {
26 
28 
37 template <typename... T>
38 std::string format(fmt::format_string<T...> pattern, T&&... args);
39 
41 
50 template <typename... T>
51 std::wstring format(fmt::wformat_string<T...> pattern, T&&... args);
52 
54 
62 template <typename... T>
63 void print(fmt::format_string<T...> pattern, T&&... args);
64 
66 
74 template <typename... T>
75 void print(fmt::wformat_string<T...> pattern, T&&... args);
76 
78 
87 template <typename TOutputStream, typename... T>
88 void print(TOutputStream& stream, fmt::format_string<T...> pattern, T&&... args);
89 
91 
100 template <typename TOutputStream, typename... T>
101 void print(TOutputStream& stream, fmt::wformat_string<T...> pattern, T&&... args);
102 
105 } // namespace CppCommon
106 
107 #include "format.inl"
108 
109 #endif // CPPCOMMON_STRING_FORMAT_H
Format string inline implementation.
C++ Common project definitions.
Definition: token_bucket.h:15
std::string format(fmt::format_string< T... > pattern, T &&... args)
Format string.
Definition: format.inl:12
void print(fmt::format_string< T... > pattern, T &&... args)
Format string and print it into the std::cout.
Definition: format.inl:24