Add sprintf overload for wide strings
and fix an issue in formatting user-defined objects. Thanks to @ScottLangham
This commit is contained in:
1 parent
79d8f59906
commit
ef710dee6c
4 files changed
+27
-5
No files matched your search
@@ -2706,6 +2706,12 @@ inline std::string sprintf(CStringRef format, ArgList args) {
|
||||
return w.str();
|
||||
}
|
||||
|
||||
inline std::wstring sprintf(WCStringRef format, ArgList args) {
|
||||
WMemoryWriter w;
|
||||
printf(w, format, args);
|
||||
return w.str();
|
||||
}
|
||||
|
||||
/**
|
||||
\rst
|
||||
Prints formatted data to the file *f*.
|
||||
@@ -2994,6 +3000,7 @@ FMT_VARIADIC(void, print, std::FILE *, CStringRef)
|
||||
FMT_VARIADIC(void, print, std::ostream &, CStringRef)
|
||||
FMT_VARIADIC(void, print_colored, Color, CStringRef)
|
||||
FMT_VARIADIC(std::string, sprintf, CStringRef)
|
||||
FMT_VARIADIC_W(std::wstring, sprintf, WCStringRef)
|
||||
FMT_VARIADIC(int, printf, CStringRef)
|
||||
FMT_VARIADIC(int, fprintf, std::FILE *, CStringRef)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user