mirror of
https://github.com/boostorg/utility.git
synced 2025-05-11 13:24:02 +00:00
rename routines in detail namespace so that someone who includes both <string_ref> and <string_view> won't get duplicate decls
This commit is contained in:
parent
c56dd13592
commit
c5b1256650
@ -416,7 +416,7 @@ namespace boost {
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
inline void sr_insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
||||||
enum { chunk_size = 8 };
|
enum { chunk_size = 8 };
|
||||||
charT fill_chars[chunk_size];
|
charT fill_chars[chunk_size];
|
||||||
std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
|
std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
|
||||||
@ -427,19 +427,19 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
void insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_ref<charT,traits>& str) {
|
void sr_insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_ref<charT,traits>& str) {
|
||||||
const std::size_t size = str.size();
|
const std::size_t size = str.size();
|
||||||
const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
|
const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
|
||||||
const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
|
const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
|
||||||
if (!align_left) {
|
if (!align_left) {
|
||||||
detail::insert_fill_chars(os, alignment_size);
|
detail::sr_insert_fill_chars(os, alignment_size);
|
||||||
if (os.good())
|
if (os.good())
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
if (os.good())
|
if (os.good())
|
||||||
detail::insert_fill_chars(os, alignment_size);
|
detail::sr_insert_fill_chars(os, alignment_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -455,7 +455,7 @@ namespace boost {
|
|||||||
if (w <= size)
|
if (w <= size)
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
else
|
else
|
||||||
detail::insert_aligned(os, str);
|
detail::sr_insert_aligned(os, str);
|
||||||
os.width(0);
|
os.width(0);
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
|
@ -549,7 +549,7 @@ namespace boost {
|
|||||||
namespace detail {
|
namespace detail {
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
inline void insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
inline void sv_insert_fill_chars(std::basic_ostream<charT, traits>& os, std::size_t n) {
|
||||||
enum { chunk_size = 8 };
|
enum { chunk_size = 8 };
|
||||||
charT fill_chars[chunk_size];
|
charT fill_chars[chunk_size];
|
||||||
std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
|
std::fill_n(fill_chars, static_cast< std::size_t >(chunk_size), os.fill());
|
||||||
@ -560,19 +560,19 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class charT, class traits>
|
template<class charT, class traits>
|
||||||
void insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_view<charT,traits>& str) {
|
void sv_insert_aligned(std::basic_ostream<charT, traits>& os, const basic_string_view<charT,traits>& str) {
|
||||||
const std::size_t size = str.size();
|
const std::size_t size = str.size();
|
||||||
const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
|
const std::size_t alignment_size = static_cast< std::size_t >(os.width()) - size;
|
||||||
const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
|
const bool align_left = (os.flags() & std::basic_ostream<charT, traits>::adjustfield) == std::basic_ostream<charT, traits>::left;
|
||||||
if (!align_left) {
|
if (!align_left) {
|
||||||
detail::insert_fill_chars(os, alignment_size);
|
detail::sv_insert_fill_chars(os, alignment_size);
|
||||||
if (os.good())
|
if (os.good())
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
if (os.good())
|
if (os.good())
|
||||||
detail::insert_fill_chars(os, alignment_size);
|
detail::sv_insert_fill_chars(os, alignment_size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,7 +589,7 @@ namespace boost {
|
|||||||
if (w <= size)
|
if (w <= size)
|
||||||
os.write(str.data(), size);
|
os.write(str.data(), size);
|
||||||
else
|
else
|
||||||
detail::insert_aligned(os, str);
|
detail::sv_insert_aligned(os, str);
|
||||||
os.width(0);
|
os.width(0);
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user