Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
printf.cc
Go to the documentation of this file.
1/*
2 Formatting library for C++
3
4 Copyright (c) 2012 - 2016, Victor Zverovich
5 All rights reserved.
6
7 For the license information refer to format.h.
8 */
9
10#include "format.h"
11#include "printf.h"
12
13namespace fmt {
14
15template <typename Char>
16void printf(BasicWriter<Char> &w, BasicCStringRef<Char> format, ArgList args);
17
18FMT_FUNC int fprintf(std::FILE *f, CStringRef format, ArgList args) {
19 MemoryWriter w;
20 printf(w, format, args);
21 std::size_t size = w.size();
22 return std::fwrite(w.data(), 1, size, f) < size ? -1 : static_cast<int>(size);
23}
24
25#ifndef FMT_HEADER_ONLY
26
27template void PrintfFormatter<char>::format(CStringRef format);
28template void PrintfFormatter<wchar_t>::format(WCStringRef format);
29
30#endif // FMT_HEADER_ONLY
31
32} // namespace fmt
std::size_t size() const
Definition format.h:2727
const Char * data() const FMT_NOEXCEPT
Definition format.h:2733
Definition format.h:408
FMT_FUNC int fprintf(std::FILE *f, CStringRef format, ArgList args)
Definition printf.cc:18
void printf(BasicWriter< Char > &w, BasicCStringRef< Char > format, ArgList args)
void printf(Writer &w, CStringRef format, ArgList args)
Definition printf.h:522
Definition json.hpp:4518
#define FMT_FUNC
Definition format.h:4170