Warning, /include/c++/v1/__cxx03/format is written in an unsupported language. File is not indexed.
0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009
0010 #ifndef _LIBCPP___CXX03_FORMAT
0011 #define _LIBCPP___CXX03_FORMAT
0012
0013 /*
0014
0015 namespace std {
0016 // [format.context], class template basic_format_context
0017 template<class Out, class charT> class basic_format_context;
0018 using format_context = basic_format_context<unspecified, char>;
0019 using wformat_context = basic_format_context<unspecified, wchar_t>;
0020
0021 // [format.args], class template basic_format_args
0022 template<class Context> class basic_format_args;
0023 using format_args = basic_format_args<format_context>;
0024 using wformat_args = basic_format_args<wformat_context>;
0025
0026 // [format.fmt.string], class template basic_format_string
0027 template<class charT, class... Args>
0028 struct basic_format_string { // since C++23, exposition only before C++23
0029 private:
0030 basic_string_view<charT> str; // exposition only
0031
0032 public:
0033 template<class T> consteval basic_format_string(const T& s);
0034 basic_format_string(runtime-format-string<charT> s) noexcept : str(s.str) {} // since C++26
0035
0036 constexpr basic_string_view<charT> get() const noexcept { return str; }
0037 };
0038 template<class... Args>
0039 using format_string = // since C++23, exposition only before C++23
0040 basic_format_string<char, type_identity_t<Args>...>;
0041 template<class... Args>
0042 using wformat_string = // since C++23, exposition only before C++23
0043 basic_format_string<wchar_t, type_identity_t<Args>...>;
0044
0045 template<class charT> struct runtime-format-string { // since C++26, exposition-only
0046 private:
0047 basic_string_view<charT> str; // exposition-only
0048
0049 public:
0050 runtime-format-string(basic_string_view<charT> s) noexcept : str(s) {}
0051
0052 runtime-format-string(const runtime-format-string&) = delete;
0053 runtime-format-string& operator=(const runtime-format-string&) = delete;
0054 };
0055
0056 runtime-format-string<char> runtime_format(string_view fmt) noexcept {
0057 return fmt;
0058 }
0059 runtime-format-string<wchar_t> runtime_format(wstring_view fmt) noexcept {
0060 return fmt;
0061 }
0062
0063 // [format.functions], formatting functions
0064 template<class... Args>
0065 string format(format-string<Args...> fmt, Args&&... args);
0066 template<class... Args>
0067 wstring format(wformat-string<Args...> fmt, Args&&... args);
0068 template<class... Args>
0069 string format(const locale& loc, format-string<Args...> fmt, Args&&... args);
0070 template<class... Args>
0071 wstring format(const locale& loc, wformat-string<Args...> fmt, Args&&... args);
0072
0073 string vformat(string_view fmt, format_args args);
0074 wstring vformat(wstring_view fmt, wformat_args args);
0075 string vformat(const locale& loc, string_view fmt, format_args args);
0076 wstring vformat(const locale& loc, wstring_view fmt, wformat_args args);
0077
0078 template<class Out, class... Args>
0079 Out format_to(Out out, format-string<Args...> fmt, Args&&... args);
0080 template<class Out, class... Args>
0081 Out format_to(Out out, wformat-string<Args...> fmt, Args&&... args);
0082 template<class Out, class... Args>
0083 Out format_to(Out out, const locale& loc, format-string<Args...> fmt, Args&&... args);
0084 template<class Out, class... Args>
0085 Out format_to(Out out, const locale& loc, wformat-string<Args...> fmt, Args&&... args);
0086
0087 template<class Out>
0088 Out vformat_to(Out out, string_view fmt, format_args args);
0089 template<class Out>
0090 Out vformat_to(Out out, wstring_view fmt, wformat_args args);
0091 template<class Out>
0092 Out vformat_to(Out out, const locale& loc, string_view fmt,
0093 format_args char> args);
0094 template<class Out>
0095 Out vformat_to(Out out, const locale& loc, wstring_view fmt,
0096 wformat_args args);
0097
0098 template<class Out> struct format_to_n_result {
0099 Out out;
0100 iter_difference_t<Out> size;
0101 };
0102 template<class Out, class... Args>
0103 format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
0104 format-string<Args...> fmt, Args&&... args);
0105 template<class Out, class... Args>
0106 format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
0107 wformat-string<Args...> fmt, Args&&... args);
0108 template<class Out, class... Args>
0109 format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
0110 const locale& loc, format-string<Args...> fmt,
0111 Args&&... args);
0112 template<class Out, class... Args>
0113 format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
0114 const locale& loc, wformat-string<Args...> fmt,
0115 Args&&... args);
0116
0117 template<class... Args>
0118 size_t formatted_size(format-string<Args...> fmt, Args&&... args);
0119 template<class... Args>
0120 size_t formatted_size(wformat-string<Args...> fmt, Args&&... args);
0121 template<class... Args>
0122 size_t formatted_size(const locale& loc, format-string<Args...> fmt, Args&&... args);
0123 template<class... Args>
0124 size_t formatted_size(const locale& loc, wformat-string<Args...> fmt, Args&&... args);
0125
0126 // [format.formatter], formatter
0127 template<class T, class charT = char> struct formatter;
0128
0129 // [format.parse.ctx], class template basic_format_parse_context
0130 template<class charT> class basic_format_parse_context;
0131 using format_parse_context = basic_format_parse_context<char>;
0132 using wformat_parse_context = basic_format_parse_context<wchar_t>;
0133
0134 // [format.range], formatting of ranges
0135 // [format.range.fmtkind], variable template format_kind
0136 enum class range_format { // since C++23
0137 disabled,
0138 map,
0139 set,
0140 sequence,
0141 string,
0142 debug_string
0143 };
0144
0145 template<class R>
0146 constexpr unspecified format_kind = unspecified; // since C++23
0147
0148 template<ranges::input_range R>
0149 requires same_as<R, remove_cvref_t<R>>
0150 constexpr range_format format_kind<R> = see below; // since C++23
0151
0152 // [format.range.formatter], class template range_formatter
0153 template<class T, class charT = char>
0154 requires same_as<remove_cvref_t<T>, T> && formattable<T, charT>
0155 class range_formatter; // since C++23
0156
0157 // [format.range.fmtdef], class template range-default-formatter
0158 template<range_format K, ranges::input_range R, class charT>
0159 struct range-default-formatter; // exposition only, since C++23
0160
0161 // [format.range.fmtmap], [format.range.fmtset], [format.range.fmtstr],
0162 // specializations for maps, sets, and strings
0163 template<ranges::input_range R, class charT>
0164 requires (format_kind<R> != range_format::disabled) &&
0165 formattable<ranges::range_reference_t<R>, charT>
0166 struct formatter<R, charT> : range-default-formatter<format_kind<R>, R, charT> { }; // since C++23
0167
0168 // [format.arguments], arguments
0169 // [format.arg], class template basic_format_arg
0170 template<class Context> class basic_format_arg;
0171
0172 template<class Visitor, class Context>
0173 see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); // Deprecated in C++26
0174
0175 // [format.arg.store], class template format-arg-store
0176 template<class Context, class... Args> struct format-arg-store; // exposition only
0177
0178 template<class Context = format_context, class... Args>
0179 format-arg-store<Context, Args...>
0180 make_format_args(Args&... args);
0181 template<class... Args>
0182 format-arg-store<wformat_context, Args...>
0183 make_wformat_args(Args&... args);
0184
0185 // [format.error], class format_error
0186 class format_error;
0187 }
0188
0189 */
0190
0191 #include <__cxx03/__config>
0192
0193 #if _LIBCPP_STD_VER >= 20
0194 # include <__cxx03/__format/buffer.h>
0195 # include <__cxx03/__format/concepts.h>
0196 # include <__cxx03/__format/container_adaptor.h>
0197 # include <__cxx03/__format/enable_insertable.h>
0198 # include <__cxx03/__format/escaped_output_table.h>
0199 # include <__cxx03/__format/extended_grapheme_cluster_table.h>
0200 # include <__cxx03/__format/format_arg.h>
0201 # include <__cxx03/__format/format_arg_store.h>
0202 # include <__cxx03/__format/format_args.h>
0203 # include <__cxx03/__format/format_context.h>
0204 # include <__cxx03/__format/format_error.h>
0205 # include <__cxx03/__format/format_functions.h>
0206 # include <__cxx03/__format/format_parse_context.h>
0207 # include <__cxx03/__format/format_string.h>
0208 # include <__cxx03/__format/format_to_n_result.h>
0209 # include <__cxx03/__format/formatter.h>
0210 # include <__cxx03/__format/formatter_bool.h>
0211 # include <__cxx03/__format/formatter_char.h>
0212 # include <__cxx03/__format/formatter_floating_point.h>
0213 # include <__cxx03/__format/formatter_integer.h>
0214 # include <__cxx03/__format/formatter_pointer.h>
0215 # include <__cxx03/__format/formatter_string.h>
0216 # include <__cxx03/__format/formatter_tuple.h>
0217 # include <__cxx03/__format/parser_std_format_spec.h>
0218 # include <__cxx03/__format/range_default_formatter.h>
0219 # include <__cxx03/__format/range_formatter.h>
0220 # include <__cxx03/__format/unicode.h>
0221 # include <__cxx03/__fwd/format.h>
0222 #endif
0223
0224 #include <__cxx03/version>
0225
0226 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0227 # pragma GCC system_header
0228 #endif
0229
0230 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
0231 # include <__cxx03/array>
0232 # include <__cxx03/cctype>
0233 # include <__cxx03/cerrno>
0234 # include <__cxx03/clocale>
0235 # include <__cxx03/cmath>
0236 # include <__cxx03/cstddef>
0237 # include <__cxx03/cstdint>
0238 # include <__cxx03/cstdlib>
0239 # include <__cxx03/cstring>
0240 # include <__cxx03/initializer_list>
0241 # include <__cxx03/limits>
0242 # include <__cxx03/locale>
0243 # include <__cxx03/new>
0244 # include <__cxx03/optional>
0245 # include <__cxx03/queue>
0246 # include <__cxx03/stack>
0247 # include <__cxx03/stdexcept>
0248 # include <__cxx03/string>
0249 # include <__cxx03/string_view>
0250 # include <__cxx03/tuple>
0251
0252 # if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS)
0253 # include <__cxx03/cwchar>
0254 # endif
0255 #endif
0256
0257 #endif // _LIBCPP___CXX03_FORMAT