MCPcopy Create free account
hub / github.com/LemLib/LemLib / parse_align

Method parse_align

include/fmt/format.h:2198–2231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2196
2197// DEPRECATED!
2198template <typename Char> FMT_CONSTEXPR auto parse_align(const Char* begin, const Char* end, format_specs<Char>& specs)
2199 -> const Char* {
2200 FMT_ASSERT(begin != end, "");
2201 auto align = align::none;
2202 auto p = begin + code_point_length(begin);
2203 if (end - p <= 0) p = begin;
2204 for (;;) {
2205 switch (to_ascii(*p)) {
2206 case '<': align = align::left; break;
2207 case '>': align = align::right; break;
2208 case '^': align = align::center; break;
2209 }
2210 if (align != align::none) {
2211 if (p != begin) {
2212 auto c = *begin;
2213 if (c == '}') return begin;
2214 if (c == '{') {
2215 throw_format_error("invalid fill character '{'");
2216 return begin;
2217 }
2218 specs.fill = {begin, to_unsigned(p - begin)};
2219 begin = p + 1;
2220 } else {
2221 ++begin;
2222 }
2223 break;
2224 } else if (p == begin) {
2225 break;
2226 }
2227 p = begin;
2228 }
2229 specs.align = align;
2230 return begin;
2231}
2232
2233// A floating-point presentation format.
2234enum class float_format : unsigned char {

Callers

nothing calls this directly

Calls 4

code_point_lengthFunction · 0.85
to_asciiFunction · 0.85
throw_format_errorFunction · 0.85
to_unsignedFunction · 0.85

Tested by

no test coverage detected