| 3112 | detail::dynamic_format_specs<Char> specs_; |
| 3113 | |
| 3114 | public: |
| 3115 | // Parses format specifiers stopping either at the end of the range or at the |
| 3116 | // terminating '}'. |
| 3117 | template <typename ParseContext> |
| 3118 | FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) { |
| 3119 | auto begin = ctx.begin(), end = ctx.end(); |
| 3120 | if (begin == end) return begin; |
| 3121 | using handler_type = detail::dynamic_specs_handler<ParseContext>; |
| 3122 | auto type = detail::type_constant<T, Char>::value; |
| 3123 | auto checker = |
| 3124 | detail::specs_checker<handler_type>(handler_type(specs_, ctx), type); |
| 3125 | auto it = detail::parse_format_specs(begin, end, checker); |
| 3126 | auto eh = ctx.error_handler(); |
| 3127 | switch (type) { |
| 3128 | case detail::type::none_type: |
| 3129 | FMT_ASSERT(false, "invalid argument type"); |
| 3130 | break; |
| 3131 | case detail::type::bool_type: |
| 3132 | if (specs_.type == presentation_type::none || |
| 3133 | specs_.type == presentation_type::string) { |
| 3134 | break; |
| 3135 | } |
| 3136 | FMT_FALLTHROUGH; |
| 3137 | case detail::type::int_type: |
| 3138 | case detail::type::uint_type: |
| 3139 | case detail::type::long_long_type: |
| 3140 | case detail::type::ulong_long_type: |
| 3141 | case detail::type::int128_type: |
| 3142 | case detail::type::uint128_type: |
| 3143 | detail::check_int_type_spec(specs_.type, eh); |
| 3144 | break; |
| 3145 | case detail::type::char_type: |
| 3146 | detail::check_char_specs(specs_, eh); |
| 3147 | break; |
| 3148 | case detail::type::float_type: |
| 3149 | if (detail::const_check(FMT_USE_FLOAT)) |
| 3150 | detail::parse_float_type_spec(specs_, eh); |
| 3151 | else |
| 3152 | FMT_ASSERT(false, "float support disabled"); |
| 3153 | break; |
| 3154 | case detail::type::double_type: |
| 3155 | if (detail::const_check(FMT_USE_DOUBLE)) |
| 3156 | detail::parse_float_type_spec(specs_, eh); |
| 3157 | else |
| 3158 | FMT_ASSERT(false, "double support disabled"); |
| 3159 | break; |
| 3160 | case detail::type::long_double_type: |
| 3161 | if (detail::const_check(FMT_USE_LONG_DOUBLE)) |
| 3162 | detail::parse_float_type_spec(specs_, eh); |
| 3163 | else |
| 3164 | FMT_ASSERT(false, "long double support disabled"); |
| 3165 | break; |
| 3166 | case detail::type::cstring_type: |
| 3167 | detail::check_cstring_type_spec(specs_.type, eh); |
| 3168 | break; |
| 3169 | case detail::type::string_type: |
| 3170 | detail::check_string_type_spec(specs_.type, eh); |
| 3171 | break; |
no test coverage detected