// Formatting library for C++ - std::ostream support // // Copyright (c) 2012 - present, Victor Zverovich // All rights reserved. // // For the license information refer to format.h.
#ifndef FMT_OSTREAM_H_ #define FMT_OSTREAM_H_
#ifndef FMT_MODULE # include <fstream> // std::filebuf #endif
#ifdef _WIN32 # ifdef __GLIBCXX__ # include <ext/stdio_filebuf.h> # include <ext/stdio_sync_filebuf.h> # endif # include <io.h> #endif
#include"chrono.h"// formatbuf
FMT_BEGIN_NAMESPACE namespace detail {
// Generate a unique explicit instantion in every translation unit using a tag // type in an anonymous namespace. namespace { struct file_access_tag {};
} // namespace template <typename Tag, typename BufType, FILE* BufType::*FileMemberPtr> class file_access { friendauto get_file(BufType& obj) -> FILE* { return obj.*FileMemberPtr; }
};
// Write the content of buf to os. // It is a separate function rather than a part of vprint to simplify testing. template <typenameChar> void write_buffer(std::basic_ostream<Char>& os, buffer<Char>& buf) { constChar* buf_data = buf.data(); using unsigned_streamsize = make_unsigned_t<std::streamsize>;
unsigned_streamsize size = buf.size();
unsigned_streamsize max_size = to_unsigned(max_value<std::streamsize>()); do {
unsigned_streamsize n = size <= max_size ? size : max_size;
os.write(buf_data, static_cast<std::streamsize>(n));
buf_data += n;
size -= n;
} while (size != 0);
}
// Formats an object of type T that has an overloaded ostream operator<<. template <typenameChar> struct basic_ostream_formatter : formatter<basic_string_view<Char>, Char> { void set_debug_format() = delete;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.