Home | History | Annotate | Download | only in Support

Lines Matching refs:Style

78   static bool consumeHexStyle(StringRef &Str, HexPrintStyle &Style) {
83 Style = HexPrintStyle::Lower;
85 Style = HexPrintStyle::Upper;
87 Style = HexPrintStyle::PrefixLower;
89 Style = HexPrintStyle::PrefixUpper;
93 static size_t consumeNumHexDigits(StringRef &Str, HexPrintStyle Style,
96 if (isPrefixedHexStyle(Style))
107 /// integer_options :: [style][digits]
108 /// style :: <see table below>
112 /// | style | Meaning | Example | Digits Meaning |
132 static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
135 if (consumeHexStyle(Style, HS)) {
136 Digits = consumeNumHexDigits(Style, HS, 0);
142 if (Style.consume_front("N") || Style.consume_front("n"))
144 else if (Style.consume_front("D") || Style.consume_front("d"))
147 Style.consumeInteger(10, Digits);
148 assert(Style.empty() && "Invalid integral format style!");
157 /// pointer_options :: [style][precision]
158 /// style :: <see table below>
181 static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
183 consumeHexStyle(Style, HS);
184 size_t Digits = consumeNumHexDigits(Style, HS, sizeof(void *) * 2);
189 /// Implementation of format_provider<T> for c-style strings and string
203 static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
205 if (!Style.empty() && Style.getAsInteger(10, N)) {
206 assert(false && "Style is not a valid integer");
219 StringRef Style) {
220 format_provider<std::string>::format(V.str(), Stream, Style);
237 StringRef Style) {
238 if (Style.empty())
242 format_provider<int>::format(X, Stream, Style);
265 StringRef Style) {
266 Stream << StringSwitch<const char *>(Style)
280 /// float_options :: [style][precision]
281 /// style :: <see table below>
285 /// | style | Meaning | Example |
303 static void format(const T &V, llvm::raw_ostream &Stream, StringRef Style) {
305 if (Style.consume_front("P") || Style.consume_front("p"))
307 else if (Style.consume_front("F") || Style.consume_front("f"))
309 else if (Style.consume_front("E"))
311 else if (Style.consume_front("e"))
316 Optional<size_t> Precision = parseNumericPrecision(Style);
347 /// items in the range and the argument expression is the Style specification to
361 static StringRef consumeOneOption(StringRef &Style, char Indicator,
363 if (Style.empty())
365 if (Style.front() != Indicator)
367 Style = Style.drop_front();
368 if (Style.empty()) {
369 assert(false && "Invalid range style");
374 if (Style.front() != D[0])
376 size_t End = Style.find_first_of(D[1]);
381 StringRef Result = Style.slice(1, End);
382 Style = Style.drop_front(End + 1);
385 assert(false && "Invalid range style!");
389 static std::pair<StringRef, StringRef> parseOptions(StringRef Style) {
390 StringRef Sep = consumeOneOption(Style, '$', ", ");
391 StringRef Args = consumeOneOption(Style, '@', "");
392 assert(Style.empty() && "Unexpected text in range option string!");
400 llvm::raw_ostream &Stream, StringRef Style) {
403 std::tie(Sep, ArgStyle) = parseOptions(Style);