1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 11:19:10 +00:00

Merge pull request #430 from zrax/plFormat_stuff

Start taking over the world with plFormat
This commit is contained in:
2014-05-28 22:25:39 -04:00
113 changed files with 627 additions and 716 deletions

View File

@ -449,7 +449,7 @@ PL_FORMAT_IMPL(double)
PL_FORMAT_IMPL(char)
{
/* Note: The use of unsigned here is not a typo -- we only format decimal
values with a sign, so we can convert everything else to unsigned. */
values with a sign, so we can convert everything else to unsigned. */
switch (format.fDigitClass) {
case plFormat_Private::kDigitBin:
return _formatNumeric<unsigned char>(format, value, 2);

View File

@ -251,4 +251,17 @@ plString plFormat(const char *fmt_str, _Type value, _Args... args)
return plFormat_Private::_IFormat(data, args...);
}
template <typename _Type, typename... _Args>
void plPrintf(FILE *fd, const char *fmt_str, _Type value, _Args... args)
{
plString output = plFormat(fmt_str, value, args...);
fwrite(output.c_str(), sizeof(char), output.GetSize(), fd);
}
template <typename _Type, typename... _Args>
void plPrintf(const char *fmt_str, _Type value, _Args... args)
{
plPrintf(stdout, fmt_str, value, args...);
}
#endif // plFormat_Defined