mirror of https://github.com/gabime/spdlog.git
Updated fmto to version def687462c32ec40757e49eb6069f109d50236d6
parent
e12916c070
commit
d142f13551
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,35 +1,37 @@
|
|||||||
/*
|
/*
|
||||||
Formatting library for C++ - std::ostream support
|
Formatting library for C++ - std::ostream support
|
||||||
|
|
||||||
Copyright (c) 2012 - 2016, Victor Zverovich
|
Copyright (c) 2012 - 2016, Victor Zverovich
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
For the license information refer to format.h.
|
For the license information refer to format.h.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ostream.h"
|
#include "ostream.h"
|
||||||
|
|
||||||
namespace fmt {
|
namespace fmt {
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
FMT_FUNC void write(std::ostream &os, Writer &w) {
|
FMT_FUNC void write(std::ostream &os, Writer &w)
|
||||||
const char *data = w.data();
|
{
|
||||||
typedef internal::MakeUnsigned<std::streamsize>::Type UnsignedStreamSize;
|
const char *data = w.data();
|
||||||
UnsignedStreamSize size = w.size();
|
typedef internal::MakeUnsigned<std::streamsize>::Type UnsignedStreamSize;
|
||||||
UnsignedStreamSize max_size =
|
UnsignedStreamSize size = w.size();
|
||||||
internal::to_unsigned((std::numeric_limits<std::streamsize>::max)());
|
UnsignedStreamSize max_size =
|
||||||
do {
|
internal::to_unsigned((std::numeric_limits<std::streamsize>::max)());
|
||||||
UnsignedStreamSize n = size <= max_size ? size : max_size;
|
do {
|
||||||
os.write(data, static_cast<std::streamsize>(n));
|
UnsignedStreamSize n = size <= max_size ? size : max_size;
|
||||||
data += n;
|
os.write(data, static_cast<std::streamsize>(n));
|
||||||
size -= n;
|
data += n;
|
||||||
} while (size != 0);
|
size -= n;
|
||||||
}
|
} while (size != 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args) {
|
|
||||||
MemoryWriter w;
|
FMT_FUNC void print(std::ostream &os, CStringRef format_str, ArgList args)
|
||||||
w.write(format_str, args);
|
{
|
||||||
internal::write(os, w);
|
MemoryWriter w;
|
||||||
}
|
w.write(format_str, args);
|
||||||
} // namespace fmt
|
internal::write(os, w);
|
||||||
|
}
|
||||||
|
} // namespace fmt
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue