mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-30 05:40:06 +00:00
Remove unused functions
This commit is contained in:
parent
93bfa05382
commit
9c5cd998d1
@ -423,26 +423,6 @@ FMT_CONSTEXPR ansi_color_escape<Char> make_emphasis(emphasis em) noexcept {
|
|||||||
return ansi_color_escape<Char>(em);
|
return ansi_color_escape<Char>(em);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename Char> inline void fputs(const Char* chars, FILE* stream) {
|
|
||||||
int result = std::fputs(chars, stream);
|
|
||||||
if (result < 0)
|
|
||||||
FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <> inline void fputs<wchar_t>(const wchar_t* chars, FILE* stream) {
|
|
||||||
int result = std::fputws(chars, stream);
|
|
||||||
if (result < 0)
|
|
||||||
FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Char> inline void reset_color(FILE* stream) {
|
|
||||||
fputs("\x1b[0m", stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <> inline void reset_color<wchar_t>(FILE* stream) {
|
|
||||||
fputs(L"\x1b[0m", stream);
|
|
||||||
}
|
|
||||||
|
|
||||||
template <typename Char> inline void reset_color(buffer<Char>& buffer) {
|
template <typename Char> inline void reset_color(buffer<Char>& buffer) {
|
||||||
auto reset_color = string_view("\x1b[0m");
|
auto reset_color = string_view("\x1b[0m");
|
||||||
buffer.append(reset_color.begin(), reset_color.end());
|
buffer.append(reset_color.begin(), reset_color.end());
|
||||||
@ -479,17 +459,19 @@ void vformat_to(buffer<Char>& buf, const text_style& ts,
|
|||||||
|
|
||||||
FMT_END_DETAIL_NAMESPACE
|
FMT_END_DETAIL_NAMESPACE
|
||||||
|
|
||||||
template <typename S, typename Char = char_t<S>>
|
inline void vprint(std::FILE* f, const text_style& ts, string_view fmt,
|
||||||
void vprint(std::FILE* f, const text_style& ts, const S& format,
|
format_args args) {
|
||||||
basic_format_args<buffer_context<type_identity_t<Char>>> args) {
|
// Legacy wide streams are not supported.
|
||||||
basic_memory_buffer<Char> buf;
|
auto buf = memory_buffer();
|
||||||
detail::vformat_to(buf, ts, detail::to_string_view(format), args);
|
detail::vformat_to(buf, ts, fmt, args);
|
||||||
if (detail::is_utf8()) {
|
if (detail::is_utf8()) {
|
||||||
detail::print(f, basic_string_view<Char>(buf.begin(), buf.size()));
|
detail::print(f, string_view(buf.begin(), buf.size()));
|
||||||
} else {
|
return;
|
||||||
buf.push_back(Char(0));
|
|
||||||
detail::fputs(buf.data(), f);
|
|
||||||
}
|
}
|
||||||
|
buf.push_back('\0');
|
||||||
|
int result = std::fputs(buf.data(), f);
|
||||||
|
if (result < 0)
|
||||||
|
FMT_THROW(system_error(errno, FMT_STRING("cannot write to file")));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user