12 template <
typename CHAR_T>
13 constexpr FormatString<CHAR_T>::FormatString (
const basic_string_view<CHAR_T>& s)
17 template <
typename CHAR_T>
22 template <
typename CHAR_T>
25 return qStroika_Foundation_Characters_FMT_PREFIX_::wstring_view{fSV_.data (), fSV_.size ()};
27 template <
typename CHAR_T>
28 template <Common::StdCompat::formattable<
wchar_t>... ARGS>
31 return Common::StdCompat::vformat (getx_ (), Common::StdCompat::make_wformat_args (args...));
33 template <
typename CHAR_T>
34 template <Common::StdCompat::formattable<
wchar_t>... ARGS>
35 [[nodiscard]]
inline String FormatString<CHAR_T>::operator() (
const locale& loc, ARGS&&... args)
const
37 return Common::StdCompat::vformat (loc, getx_ (), Common::StdCompat::make_wformat_args (args...));
39#if qCompilerAndStdLib_vector_constexpr_warning_Buggy
40 DISABLE_COMPILER_GCC_WARNING_START (
"GCC diagnostic ignored \"-Winvalid-constexpr\"");
42#if qCompilerAndStdLib_vector_constexpr_Buggy
47 FormatString<char>::FormatString (
const FormatString& src)
48 : fStringData_{src.fStringData_}
49 , fFmtStr_{basic_string_view<wchar_t>{fStringData_.data (), fStringData_.size ()}}
52#if qCompilerAndStdLib_vector_constexpr_Buggy
57 FormatString<char>::FormatString (
const basic_string_view<char>& s)
58 : fStringData_{s.begin (), s.end ()}
59 , fFmtStr_{basic_string_view<wchar_t>{fStringData_.data (), fStringData_.size ()}}
65 return fFmtStr_.get ();
69 return fFmtStr_.getx_ ();
71 template <Stroika_Foundation_Common_formattable_FilterOnStringLitOp_BWA (Common::StdCompat::formattable<
wchar_t>)... ARGS>
72 [[nodiscard]]
inline String FormatString<char>::operator() (ARGS&&... args)
const
74 return Common::StdCompat::vformat (this->getx_ (), Common::StdCompat::make_wformat_args (args...));
76 template <Stroika_Foundation_Common_formattable_FilterOnStringLitOp_BWA (Common::StdCompat::formattable<
wchar_t>)... ARGS>
77 [[nodiscard]]
inline String FormatString<char>::operator() (
const locale& loc, ARGS&&... args)
const
79 return Common::StdCompat::vformat (loc, this->getx_ (), Common::StdCompat::make_wformat_args (args...));
87 inline namespace Literals {
88#if qCompilerAndStdLib_vector_constexpr_Buggy
102#if qCompilerAndStdLib_vector_constexpr_warning_Buggy
103 DISABLE_COMPILER_GCC_WARNING_END (
"GCC diagnostic ignored \"-Winvalid-constexpr\"");
111 template <
typename CHAR_T>
114 return Common::StdCompat::vformat (f.
getx_ (), args);
116 template <
typename CHAR_T>
117 [[nodiscard]]
inline String
VFormat (
const locale& loc,
const FormatString<CHAR_T>& f,
const Common::StdCompat::wformat_args& args)
119 return Common::StdCompat::vformat (loc, f.getx_ (), args);
127 template <
typename CHAR_T, Common::StdCompat::formattable<
wchar_t>... ARGS>
130 return VFormat (f, Common::StdCompat::make_wformat_args (args...));
132 template <
typename CHAR_T, Common::StdCompat::formattable<
wchar_t>... ARGS>
133 inline String Format (
const locale& loc,
const FormatString<CHAR_T>& f, ARGS&&... args)
135 return VFormat (loc, f, Common::StdCompat::make_wformat_args (args...));
static constexpr void CheckASCII(span< const CHAR_T > s)
if not IsASCII (arg) throw RuntimeException...
String is like std::u32string, except it is much easier to use, often much more space efficient,...
String VFormat(const FormatString< CHAR_T > &f, const Common::StdCompat::wformat_args &args)
same as std::vformat, except always uses wformat_args, and produces Stroika String (and maybe more - ...