mirror of
https://github.com/fmtlib/fmt.git
synced 2024-10-02 13:02:03 +00:00
Do *not* export namespace detail
This commit is contained in:
parent
b99c2bd345
commit
8ec0b9e33b
@ -2629,13 +2629,14 @@ std::basic_string<Char> to_string(const basic_memory_buffer<Char, SIZE>& buf) {
|
|||||||
detail::assume(size < std::basic_string<Char>().max_size());
|
detail::assume(size < std::basic_string<Char>().max_size());
|
||||||
return std::basic_string<Char>(buf.data(), size);
|
return std::basic_string<Char>(buf.data(), size);
|
||||||
}
|
}
|
||||||
FMT_MODULE_EXPORT_END
|
|
||||||
|
FMT_BEGIN_DETAIL_NAMESPACE
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
void detail::vformat_to(
|
void vformat_to(
|
||||||
detail::buffer<Char>& buf, basic_string_view<Char> fmt,
|
buffer<Char>& buf, basic_string_view<Char> fmt,
|
||||||
basic_format_args<buffer_context<type_identity_t<Char>>> args,
|
basic_format_args<buffer_context<type_identity_t<Char>>> args,
|
||||||
detail::locale_ref loc) {
|
locale_ref loc) {
|
||||||
auto out = buffer_appender<Char>(buf);
|
auto out = buffer_appender<Char>(buf);
|
||||||
if (fmt.size() == 2 && equal2(fmt.data(), "{}")) {
|
if (fmt.size() == 2 && equal2(fmt.data(), "{}")) {
|
||||||
auto arg = args.get(0);
|
auto arg = args.get(0);
|
||||||
@ -2644,13 +2645,13 @@ void detail::vformat_to(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct format_handler : detail::error_handler {
|
struct format_handler : error_handler {
|
||||||
basic_format_parse_context<Char> parse_context;
|
basic_format_parse_context<Char> parse_context;
|
||||||
buffer_context<Char> context;
|
buffer_context<Char> context;
|
||||||
|
|
||||||
format_handler(buffer_appender<Char> out, basic_string_view<Char> str,
|
format_handler(buffer_appender<Char> out, basic_string_view<Char> str,
|
||||||
basic_format_args<buffer_context<Char>> args,
|
basic_format_args<buffer_context<Char>> args,
|
||||||
detail::locale_ref loc)
|
locale_ref loc)
|
||||||
: parse_context(str), context(out, args, loc) {}
|
: parse_context(str), context(out, args, loc) {}
|
||||||
|
|
||||||
void on_text(const Char* begin, const Char* end) {
|
void on_text(const Char* begin, const Char* end) {
|
||||||
@ -2698,7 +2699,6 @@ void detail::vformat_to(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifndef FMT_HEADER_ONLY
|
#ifndef FMT_HEADER_ONLY
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
extern template void vformat_to(detail::buffer<char>&, string_view,
|
extern template void vformat_to(detail::buffer<char>&, string_view,
|
||||||
basic_format_args<format_context>,
|
basic_format_args<format_context>,
|
||||||
@ -2723,10 +2723,9 @@ extern template int snprintf_float<long double>(long double value,
|
|||||||
int precision,
|
int precision,
|
||||||
float_specs specs,
|
float_specs specs,
|
||||||
buffer<char>& buf);
|
buffer<char>& buf);
|
||||||
} // namespace detail
|
|
||||||
#endif // FMT_HEADER_ONLY
|
#endif // FMT_HEADER_ONLY
|
||||||
|
|
||||||
FMT_MODULE_EXPORT_BEGIN
|
FMT_END_DETAIL_NAMESPACE
|
||||||
inline namespace literals {
|
inline namespace literals {
|
||||||
/**
|
/**
|
||||||
\rst
|
\rst
|
||||||
|
@ -23,9 +23,7 @@ class basic_printf_parse_context : public basic_format_parse_context<Char> {
|
|||||||
};
|
};
|
||||||
template <typename OutputIt, typename Char> class basic_printf_context;
|
template <typename OutputIt, typename Char> class basic_printf_context;
|
||||||
|
|
||||||
FMT_MODULE_EXPORT_END
|
FMT_BEGIN_DETAIL_NAMESPACE
|
||||||
|
|
||||||
namespace detail {
|
|
||||||
|
|
||||||
// Checks if a value fits in int - used to avoid warnings about comparing
|
// Checks if a value fits in int - used to avoid warnings about comparing
|
||||||
// signed and unsigned integers.
|
// signed and unsigned integers.
|
||||||
@ -269,7 +267,8 @@ void vprintf(buffer<Char>& buf, basic_string_view<Char> format,
|
|||||||
basic_format_args<Context> args) {
|
basic_format_args<Context> args) {
|
||||||
Context(buffer_appender<Char>(buf), format, args).format();
|
Context(buffer_appender<Char>(buf), format, args).format();
|
||||||
}
|
}
|
||||||
} // namespace detail
|
|
||||||
|
FMT_END_DETAIL_NAMESPACE
|
||||||
|
|
||||||
// For printing into memory_buffer.
|
// For printing into memory_buffer.
|
||||||
template <typename Char, typename Context>
|
template <typename Char, typename Context>
|
||||||
@ -565,8 +564,6 @@ OutputIt basic_printf_context<OutputIt, Char>::format() {
|
|||||||
out, basic_string_view<Char>(start, detail::to_unsigned(it - start)));
|
out, basic_string_view<Char>(start, detail::to_unsigned(it - start)));
|
||||||
}
|
}
|
||||||
|
|
||||||
FMT_MODULE_EXPORT_BEGIN
|
|
||||||
|
|
||||||
template <typename Char>
|
template <typename Char>
|
||||||
using basic_printf_context_t =
|
using basic_printf_context_t =
|
||||||
basic_printf_context<detail::buffer_appender<Char>, Char>;
|
basic_printf_context<detail::buffer_appender<Char>, Char>;
|
||||||
|
Loading…
Reference in New Issue
Block a user