abseil-cpp/absl/strings/substitute.h
Go to the documentation of this file.
1 //
2 // Copyright 2017 The Abseil Authors.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // https://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16 // -----------------------------------------------------------------------------
17 // File: substitute.h
18 // -----------------------------------------------------------------------------
19 //
20 // This package contains functions for efficiently performing string
21 // substitutions using a format string with positional notation:
22 // `Substitute()` and `SubstituteAndAppend()`.
23 //
24 // Unlike printf-style format specifiers, `Substitute()` functions do not need
25 // to specify the type of the substitution arguments. Supported arguments
26 // following the format string, such as strings, string_views, ints,
27 // floats, and bools, are automatically converted to strings during the
28 // substitution process. (See below for a full list of supported types.)
29 //
30 // `Substitute()` does not allow you to specify *how* to format a value, beyond
31 // the default conversion to string. For example, you cannot format an integer
32 // in hex.
33 //
34 // The format string uses positional identifiers indicated by a dollar sign ($)
35 // and single digit positional ids to indicate which substitution arguments to
36 // use at that location within the format string.
37 //
38 // A '$$' sequence in the format string causes a literal '$' character to be
39 // output.
40 //
41 // Example 1:
42 // std::string s = Substitute("$1 purchased $0 $2 for $$10. Thanks $1!",
43 // 5, "Bob", "Apples");
44 // EXPECT_EQ("Bob purchased 5 Apples for $10. Thanks Bob!", s);
45 //
46 // Example 2:
47 // std::string s = "Hi. ";
48 // SubstituteAndAppend(&s, "My name is $0 and I am $1 years old.", "Bob", 5);
49 // EXPECT_EQ("Hi. My name is Bob and I am 5 years old.", s);
50 //
51 // Supported types:
52 // * absl::string_view, std::string, const char* (null is equivalent to "")
53 // * int32_t, int64_t, uint32_t, uint64_t
54 // * float, double
55 // * bool (Printed as "true" or "false")
56 // * pointer types other than char* (Printed as "0x<lower case hex string>",
57 // except that null is printed as "NULL")
58 //
59 // If an invalid format string is provided, Substitute returns an empty string
60 // and SubstituteAndAppend does not change the provided output string.
61 // A format string is invalid if it:
62 // * ends in an unescaped $ character,
63 // e.g. "Hello $", or
64 // * calls for a position argument which is not provided,
65 // e.g. Substitute("Hello $2", "world"), or
66 // * specifies a non-digit, non-$ character after an unescaped $ character,
67 // e.g. "Hello $f".
68 // In debug mode, i.e. #ifndef NDEBUG, such errors terminate the program.
69 
70 #ifndef ABSL_STRINGS_SUBSTITUTE_H_
71 #define ABSL_STRINGS_SUBSTITUTE_H_
72 
73 #include <cstring>
74 #include <string>
75 #include <type_traits>
76 #include <vector>
77 
78 #include "absl/base/macros.h"
79 #include "absl/base/port.h"
80 #include "absl/strings/ascii.h"
81 #include "absl/strings/escaping.h"
82 #include "absl/strings/numbers.h"
83 #include "absl/strings/str_cat.h"
84 #include "absl/strings/str_split.h"
85 #include "absl/strings/string_view.h"
86 #include "absl/strings/strip.h"
87 
88 namespace absl {
90 namespace substitute_internal {
91 
92 // Arg
93 //
94 // This class provides an argument type for `absl::Substitute()` and
95 // `absl::SubstituteAndAppend()`. `Arg` handles implicit conversion of various
96 // types to a string. (`Arg` is very similar to the `AlphaNum` class in
97 // `StrCat()`.)
98 //
99 // This class has implicit constructors.
100 class Arg {
101  public:
102  // Overloads for string-y things
103  //
104  // Explicitly overload `const char*` so the compiler doesn't cast to `bool`.
105  Arg(const char* value) // NOLINT(runtime/explicit)
107  template <typename Allocator>
108  Arg( // NOLINT
109  const std::basic_string<char, std::char_traits<char>, Allocator>&
110  value) noexcept
111  : piece_(value) {}
112  Arg(absl::string_view value) // NOLINT(runtime/explicit)
113  : piece_(value) {}
114 
115  // Overloads for primitives
116  //
117  // No overloads are available for signed and unsigned char because if people
118  // are explicitly declaring their chars as signed or unsigned then they are
119  // probably using them as 8-bit integers and would probably prefer an integer
120  // representation. However, we can't really know, so we make the caller decide
121  // what to do.
122  Arg(char value) // NOLINT(runtime/explicit)
123  : piece_(scratch_, 1) {
124  scratch_[0] = value;
125  }
126  Arg(short value) // NOLINT(*)
127  : piece_(scratch_,
128  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
129  Arg(unsigned short value) // NOLINT(*)
130  : piece_(scratch_,
131  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
132  Arg(int value) // NOLINT(runtime/explicit)
133  : piece_(scratch_,
134  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
135  Arg(unsigned int value) // NOLINT(runtime/explicit)
136  : piece_(scratch_,
137  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
138  Arg(long value) // NOLINT(*)
139  : piece_(scratch_,
140  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
141  Arg(unsigned long value) // NOLINT(*)
142  : piece_(scratch_,
143  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
144  Arg(long long value) // NOLINT(*)
145  : piece_(scratch_,
146  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
147  Arg(unsigned long long value) // NOLINT(*)
148  : piece_(scratch_,
149  numbers_internal::FastIntToBuffer(value, scratch_) - scratch_) {}
150  Arg(float value) // NOLINT(runtime/explicit)
151  : piece_(scratch_, numbers_internal::SixDigitsToBuffer(value, scratch_)) {
152  }
153  Arg(double value) // NOLINT(runtime/explicit)
154  : piece_(scratch_, numbers_internal::SixDigitsToBuffer(value, scratch_)) {
155  }
156  Arg(bool value) // NOLINT(runtime/explicit)
157  : piece_(value ? "true" : "false") {}
158 
159  Arg(Hex hex); // NOLINT(runtime/explicit)
160  Arg(Dec dec); // NOLINT(runtime/explicit)
161 
162  // vector<bool>::reference and const_reference require special help to convert
163  // to `Arg` because it requires two user defined conversions.
164  template <typename T,
167  (std::is_same<T, std::vector<bool>::reference>::value ||
169  nullptr>
170  Arg(T value) // NOLINT(google-explicit-constructor)
171  : Arg(static_cast<bool>(value)) {}
172 
173  // `void*` values, with the exception of `char*`, are printed as
174  // "0x<hex value>". However, in the case of `nullptr`, "NULL" is printed.
175  Arg(const void* value); // NOLINT(runtime/explicit)
176 
177  // Normal enums are already handled by the integer formatters.
178  // This overload matches only scoped enums.
179  template <typename T,
180  typename = typename std::enable_if<
181  std::is_enum<T>{} && !std::is_convertible<T, int>{}>::type>
182  Arg(T value) // NOLINT(google-explicit-constructor)
183  : Arg(static_cast<typename std::underlying_type<T>::type>(value)) {}
184 
185  Arg(const Arg&) = delete;
186  Arg& operator=(const Arg&) = delete;
187 
188  absl::string_view piece() const { return piece_; }
189 
190  private:
193 };
194 
195 // Internal helper function. Don't call this from outside this implementation.
196 // This interface may change without notice.
198  const absl::string_view* args_array,
199  size_t num_args);
200 
201 #if defined(ABSL_BAD_CALL_IF)
202 constexpr int CalculateOneBit(const char* format) {
203  // Returns:
204  // * 2^N for '$N' when N is in [0-9]
205  // * 0 for correct '$' escaping: '$$'.
206  // * -1 otherwise.
207  return (*format < '0' || *format > '9') ? (*format == '$' ? 0 : -1)
208  : (1 << (*format - '0'));
209 }
210 
211 constexpr const char* SkipNumber(const char* format) {
212  return !*format ? format : (format + 1);
213 }
214 
215 constexpr int PlaceholderBitmask(const char* format) {
216  return !*format
217  ? 0
218  : *format != '$' ? PlaceholderBitmask(format + 1)
219  : (CalculateOneBit(format + 1) |
220  PlaceholderBitmask(SkipNumber(format + 1)));
221 }
222 #endif // ABSL_BAD_CALL_IF
223 
224 } // namespace substitute_internal
225 
226 //
227 // PUBLIC API
228 //
229 
230 // SubstituteAndAppend()
231 //
232 // Substitutes variables into a given format string and appends to a given
233 // output string. See file comments above for usage.
234 //
235 // The declarations of `SubstituteAndAppend()` below consist of overloads
236 // for passing 0 to 10 arguments, respectively.
237 //
238 // NOTE: A zero-argument `SubstituteAndAppend()` may be used within variadic
239 // templates to allow a variable number of arguments.
240 //
241 // Example:
242 // template <typename... Args>
243 // void VarMsg(std::string* boilerplate, absl::string_view format,
244 // const Args&... args) {
245 // absl::SubstituteAndAppend(boilerplate, format, args...);
246 // }
247 //
250 }
251 
253  const substitute_internal::Arg& a0) {
254  const absl::string_view args[] = {a0.piece()};
257 }
258 
260  const substitute_internal::Arg& a0,
261  const substitute_internal::Arg& a1) {
262  const absl::string_view args[] = {a0.piece(), a1.piece()};
265 }
266 
268  const substitute_internal::Arg& a0,
270  const substitute_internal::Arg& a2) {
271  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece()};
274 }
275 
277  const substitute_internal::Arg& a0,
280  const substitute_internal::Arg& a3) {
281  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
282  a3.piece()};
285 }
286 
288  const substitute_internal::Arg& a0,
291  const substitute_internal::Arg& a3,
292  const substitute_internal::Arg& a4) {
293  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
294  a3.piece(), a4.piece()};
297 }
298 
300  const substitute_internal::Arg& a0,
303  const substitute_internal::Arg& a3,
304  const substitute_internal::Arg& a4,
305  const substitute_internal::Arg& a5) {
306  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
307  a3.piece(), a4.piece(), a5.piece()};
310 }
311 
313  const substitute_internal::Arg& a0,
316  const substitute_internal::Arg& a3,
317  const substitute_internal::Arg& a4,
318  const substitute_internal::Arg& a5,
319  const substitute_internal::Arg& a6) {
320  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
321  a3.piece(), a4.piece(), a5.piece(),
322  a6.piece()};
325 }
326 
332  const substitute_internal::Arg& a6, const substitute_internal::Arg& a7) {
333  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
334  a3.piece(), a4.piece(), a5.piece(),
335  a6.piece(), a7.piece()};
338 }
339 
346  const substitute_internal::Arg& a8) {
347  const absl::string_view args[] = {a0.piece(), a1.piece(), a2.piece(),
348  a3.piece(), a4.piece(), a5.piece(),
349  a6.piece(), a7.piece(), a8.piece()};
352 }
353 
360  const substitute_internal::Arg& a8, const substitute_internal::Arg& a9) {
361  const absl::string_view args[] = {
362  a0.piece(), a1.piece(), a2.piece(), a3.piece(), a4.piece(),
363  a5.piece(), a6.piece(), a7.piece(), a8.piece(), a9.piece()};
366 }
367 
368 #if defined(ABSL_BAD_CALL_IF)
369 // This body of functions catches cases where the number of placeholders
370 // doesn't match the number of data arguments.
371 void SubstituteAndAppend(std::string* output, const char* format)
372  ABSL_BAD_CALL_IF(
373  substitute_internal::PlaceholderBitmask(format) != 0,
374  "There were no substitution arguments "
375  "but this format string either has a $[0-9] in it or contains "
376  "an unescaped $ character (use $$ instead)");
377 
378 void SubstituteAndAppend(std::string* output, const char* format,
379  const substitute_internal::Arg& a0)
380  ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 1,
381  "There was 1 substitution argument given, but "
382  "this format string is missing its $0, contains "
383  "one of $1-$9, or contains an unescaped $ character (use "
384  "$$ instead)");
385 
386 void SubstituteAndAppend(std::string* output, const char* format,
387  const substitute_internal::Arg& a0,
389  ABSL_BAD_CALL_IF(
390  substitute_internal::PlaceholderBitmask(format) != 3,
391  "There were 2 substitution arguments given, but this format string is "
392  "missing its $0/$1, contains one of $2-$9, or contains an "
393  "unescaped $ character (use $$ instead)");
394 
395 void SubstituteAndAppend(std::string* output, const char* format,
396  const substitute_internal::Arg& a0,
399  ABSL_BAD_CALL_IF(
400  substitute_internal::PlaceholderBitmask(format) != 7,
401  "There were 3 substitution arguments given, but "
402  "this format string is missing its $0/$1/$2, contains one of "
403  "$3-$9, or contains an unescaped $ character (use $$ instead)");
404 
405 void SubstituteAndAppend(std::string* output, const char* format,
406  const substitute_internal::Arg& a0,
409  const substitute_internal::Arg& a3)
410  ABSL_BAD_CALL_IF(
411  substitute_internal::PlaceholderBitmask(format) != 15,
412  "There were 4 substitution arguments given, but "
413  "this format string is missing its $0-$3, contains one of "
414  "$4-$9, or contains an unescaped $ character (use $$ instead)");
415 
416 void SubstituteAndAppend(std::string* output, const char* format,
417  const substitute_internal::Arg& a0,
420  const substitute_internal::Arg& a3,
421  const substitute_internal::Arg& a4)
422  ABSL_BAD_CALL_IF(
423  substitute_internal::PlaceholderBitmask(format) != 31,
424  "There were 5 substitution arguments given, but "
425  "this format string is missing its $0-$4, contains one of "
426  "$5-$9, or contains an unescaped $ character (use $$ instead)");
427 
428 void SubstituteAndAppend(std::string* output, const char* format,
429  const substitute_internal::Arg& a0,
432  const substitute_internal::Arg& a3,
433  const substitute_internal::Arg& a4,
434  const substitute_internal::Arg& a5)
435  ABSL_BAD_CALL_IF(
436  substitute_internal::PlaceholderBitmask(format) != 63,
437  "There were 6 substitution arguments given, but "
438  "this format string is missing its $0-$5, contains one of "
439  "$6-$9, or contains an unescaped $ character (use $$ instead)");
440 
442  std::string* output, const char* format, const substitute_internal::Arg& a0,
446  ABSL_BAD_CALL_IF(
447  substitute_internal::PlaceholderBitmask(format) != 127,
448  "There were 7 substitution arguments given, but "
449  "this format string is missing its $0-$6, contains one of "
450  "$7-$9, or contains an unescaped $ character (use $$ instead)");
451 
453  std::string* output, const char* format, const substitute_internal::Arg& a0,
457  const substitute_internal::Arg& a7)
458  ABSL_BAD_CALL_IF(
459  substitute_internal::PlaceholderBitmask(format) != 255,
460  "There were 8 substitution arguments given, but "
461  "this format string is missing its $0-$7, contains one of "
462  "$8-$9, or contains an unescaped $ character (use $$ instead)");
463 
465  std::string* output, const char* format, const substitute_internal::Arg& a0,
470  ABSL_BAD_CALL_IF(
471  substitute_internal::PlaceholderBitmask(format) != 511,
472  "There were 9 substitution arguments given, but "
473  "this format string is missing its $0-$8, contains a $9, or "
474  "contains an unescaped $ character (use $$ instead)");
475 
477  std::string* output, const char* format, const substitute_internal::Arg& a0,
482  const substitute_internal::Arg& a9)
483  ABSL_BAD_CALL_IF(
484  substitute_internal::PlaceholderBitmask(format) != 1023,
485  "There were 10 substitution arguments given, but this "
486  "format string either doesn't contain all of $0 through $9 or "
487  "contains an unescaped $ character (use $$ instead)");
488 #endif // ABSL_BAD_CALL_IF
489 
490 // Substitute()
491 //
492 // Substitutes variables into a given format string. See file comments above
493 // for usage.
494 //
495 // The declarations of `Substitute()` below consist of overloads for passing 0
496 // to 10 arguments, respectively.
497 //
498 // NOTE: A zero-argument `Substitute()` may be used within variadic templates to
499 // allow a variable number of arguments.
500 //
501 // Example:
502 // template <typename... Args>
503 // void VarMsg(absl::string_view format, const Args&... args) {
504 // std::string s = absl::Substitute(format, args...);
505 
509  return result;
510 }
511 
516  return result;
517 }
518 
521  const substitute_internal::Arg& a1) {
524  return result;
525 }
526 
532  return result;
533 }
534 
538  const substitute_internal::Arg& a3) {
540  SubstituteAndAppend(&result, format, a0, a1, a2, a3);
541  return result;
542 }
543 
547  const substitute_internal::Arg& a3, const substitute_internal::Arg& a4) {
549  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4);
550  return result;
551 }
552 
557  const substitute_internal::Arg& a5) {
559  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4, a5);
560  return result;
561 }
562 
567  const substitute_internal::Arg& a5, const substitute_internal::Arg& a6) {
569  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4, a5, a6);
570  return result;
571 }
572 
578  const substitute_internal::Arg& a7) {
580  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4, a5, a6, a7);
581  return result;
582 }
583 
589  const substitute_internal::Arg& a7, const substitute_internal::Arg& a8) {
591  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4, a5, a6, a7, a8);
592  return result;
593 }
594 
601  const substitute_internal::Arg& a9) {
603  SubstituteAndAppend(&result, format, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9);
604  return result;
605 }
606 
607 #if defined(ABSL_BAD_CALL_IF)
608 // This body of functions catches cases where the number of placeholders
609 // doesn't match the number of data arguments.
610 std::string Substitute(const char* format)
611  ABSL_BAD_CALL_IF(substitute_internal::PlaceholderBitmask(format) != 0,
612  "There were no substitution arguments "
613  "but this format string either has a $[0-9] in it or "
614  "contains an unescaped $ character (use $$ instead)");
615 
617  ABSL_BAD_CALL_IF(
618  substitute_internal::PlaceholderBitmask(format) != 1,
619  "There was 1 substitution argument given, but "
620  "this format string is missing its $0, contains one of $1-$9, "
621  "or contains an unescaped $ character (use $$ instead)");
622 
625  ABSL_BAD_CALL_IF(
626  substitute_internal::PlaceholderBitmask(format) != 3,
627  "There were 2 substitution arguments given, but "
628  "this format string is missing its $0/$1, contains one of "
629  "$2-$9, or contains an unescaped $ character (use $$ instead)");
630 
634  ABSL_BAD_CALL_IF(
635  substitute_internal::PlaceholderBitmask(format) != 7,
636  "There were 3 substitution arguments given, but "
637  "this format string is missing its $0/$1/$2, contains one of "
638  "$3-$9, or contains an unescaped $ character (use $$ instead)");
639 
643  const substitute_internal::Arg& a3)
644  ABSL_BAD_CALL_IF(
645  substitute_internal::PlaceholderBitmask(format) != 15,
646  "There were 4 substitution arguments given, but "
647  "this format string is missing its $0-$3, contains one of "
648  "$4-$9, or contains an unescaped $ character (use $$ instead)");
649 
653  const substitute_internal::Arg& a3,
654  const substitute_internal::Arg& a4)
655  ABSL_BAD_CALL_IF(
656  substitute_internal::PlaceholderBitmask(format) != 31,
657  "There were 5 substitution arguments given, but "
658  "this format string is missing its $0-$4, contains one of "
659  "$5-$9, or contains an unescaped $ character (use $$ instead)");
660 
664  const substitute_internal::Arg& a3,
665  const substitute_internal::Arg& a4,
666  const substitute_internal::Arg& a5)
667  ABSL_BAD_CALL_IF(
668  substitute_internal::PlaceholderBitmask(format) != 63,
669  "There were 6 substitution arguments given, but "
670  "this format string is missing its $0-$5, contains one of "
671  "$6-$9, or contains an unescaped $ character (use $$ instead)");
672 
676  const substitute_internal::Arg& a3,
677  const substitute_internal::Arg& a4,
678  const substitute_internal::Arg& a5,
679  const substitute_internal::Arg& a6)
680  ABSL_BAD_CALL_IF(
681  substitute_internal::PlaceholderBitmask(format) != 127,
682  "There were 7 substitution arguments given, but "
683  "this format string is missing its $0-$6, contains one of "
684  "$7-$9, or contains an unescaped $ character (use $$ instead)");
685 
689  const substitute_internal::Arg& a3,
690  const substitute_internal::Arg& a4,
691  const substitute_internal::Arg& a5,
692  const substitute_internal::Arg& a6,
693  const substitute_internal::Arg& a7)
694  ABSL_BAD_CALL_IF(
695  substitute_internal::PlaceholderBitmask(format) != 255,
696  "There were 8 substitution arguments given, but "
697  "this format string is missing its $0-$7, contains one of "
698  "$8-$9, or contains an unescaped $ character (use $$ instead)");
699 
701  const char* format, const substitute_internal::Arg& a0,
706  ABSL_BAD_CALL_IF(
707  substitute_internal::PlaceholderBitmask(format) != 511,
708  "There were 9 substitution arguments given, but "
709  "this format string is missing its $0-$8, contains a $9, or "
710  "contains an unescaped $ character (use $$ instead)");
711 
713  const char* format, const substitute_internal::Arg& a0,
718  const substitute_internal::Arg& a9)
719  ABSL_BAD_CALL_IF(
720  substitute_internal::PlaceholderBitmask(format) != 1023,
721  "There were 10 substitution arguments given, but this "
722  "format string either doesn't contain all of $0 through $9 or "
723  "contains an unescaped $ character (use $$ instead)");
724 #endif // ABSL_BAD_CALL_IF
725 
727 } // namespace absl
728 
729 #endif // ABSL_STRINGS_SUBSTITUTE_H_
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
http2_test_server.format
format
Definition: http2_test_server.py:118
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
absl::substitute_internal::Arg::Arg
Arg(bool value)
Definition: abseil-cpp/absl/strings/substitute.h:156
absl::numbers_internal::SixDigitsToBuffer
size_t SixDigitsToBuffer(double d, char *buffer)
Definition: abseil-cpp/absl/strings/numbers.cc:486
absl::enable_if_t
typename std::enable_if< B, T >::type enable_if_t
Definition: abseil-cpp/absl/meta/type_traits.h:631
absl::substitute_internal::Arg::Arg
Arg(int value)
Definition: abseil-cpp/absl/strings/substitute.h:132
ABSL_ARRAYSIZE
#define ABSL_ARRAYSIZE(array)
Definition: abseil-cpp/absl/base/macros.h:44
ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_END
Definition: third_party/abseil-cpp/absl/base/config.h:171
Arg
Arg(64) -> Arg(128) ->Arg(256) ->Arg(512) ->Arg(1024) ->Arg(1536) ->Arg(2048) ->Arg(3072) ->Arg(4096) ->Arg(5120) ->Arg(6144) ->Arg(7168)
absl::substitute_internal::Arg::Arg
Arg(float value)
Definition: abseil-cpp/absl/strings/substitute.h:150
T
#define T(upbtypeconst, upbtype, ctype, default_value)
absl::substitute_internal::Arg::Arg
Arg(const std::basic_string< char, std::char_traits< char >, Allocator > &value) noexcept
Definition: abseil-cpp/absl/strings/substitute.h:108
absl::substitute_internal::Arg::Arg
Arg(absl::string_view value)
Definition: abseil-cpp/absl/strings/substitute.h:112
absl::NullSafeStringView
constexpr string_view NullSafeStringView(const char *p)
Definition: abseil-cpp/absl/strings/string_view.h:704
absl::substitute_internal::Arg::Arg
Arg(char value)
Definition: abseil-cpp/absl/strings/substitute.h:122
absl::substitute_internal::Arg::Arg
Arg(double value)
Definition: abseil-cpp/absl/strings/substitute.h:153
ABSL_MUST_USE_RESULT
#define ABSL_MUST_USE_RESULT
Definition: abseil-cpp/absl/base/attributes.h:441
absl::substitute_internal::Arg::Arg
Arg(const char *value)
Definition: abseil-cpp/absl/strings/substitute.h:105
absl::Hex
Definition: abseil-cpp/absl/strings/str_cat.h:134
ABSL_NAMESPACE_BEGIN
#define ABSL_NAMESPACE_BEGIN
Definition: third_party/abseil-cpp/absl/base/config.h:170
absl::substitute_internal::Arg::Arg
Arg(T value)
Definition: abseil-cpp/absl/strings/substitute.h:170
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
a2
T::first_type a2
Definition: abseil-cpp/absl/container/internal/hash_function_defaults_test.cc:307
gmock_output_test.output
output
Definition: bloaty/third_party/googletest/googlemock/test/gmock_output_test.py:175
absl::substitute_internal::Arg::piece_
absl::string_view piece_
Definition: abseil-cpp/absl/strings/substitute.h:191
absl::substitute_internal::SubstituteAndAppendArray
void SubstituteAndAppendArray(std::string *output, absl::string_view format, const absl::string_view *args_array, size_t num_args)
Definition: abseil-cpp/absl/strings/substitute.cc:29
absl::substitute_internal::Arg::scratch_
char scratch_[numbers_internal::kFastToBufferSize]
Definition: abseil-cpp/absl/strings/substitute.h:192
absl::substitute_internal::Arg::Arg
Arg(unsigned long value)
Definition: abseil-cpp/absl/strings/substitute.h:141
a1
T::first_type a1
Definition: abseil-cpp/absl/container/internal/hash_function_defaults_test.cc:305
absl::substitute_internal::Arg::Arg
Arg(short value)
Definition: abseil-cpp/absl/strings/substitute.h:126
value
const char * value
Definition: hpack_parser_table.cc:165
absl::substitute_internal::Arg::Arg
Arg(long long value)
Definition: abseil-cpp/absl/strings/substitute.h:144
std
Definition: grpcpp/impl/codegen/async_unary_call.h:407
absl::substitute_internal::Arg
Definition: abseil-cpp/absl/strings/substitute.h:100
absl::substitute_internal::Arg::Arg
Arg(long value)
Definition: abseil-cpp/absl/strings/substitute.h:138
absl::substitute_internal::Arg::operator=
Arg & operator=(const Arg &)=delete
absl::Substitute
ABSL_MUST_USE_RESULT std::string Substitute(absl::string_view format)
Definition: abseil-cpp/absl/strings/substitute.h:506
absl::numbers_internal::kFastToBufferSize
static const int kFastToBufferSize
Definition: abseil-cpp/absl/strings/numbers.h:153
absl::substitute_internal::Arg::Arg
Arg(unsigned short value)
Definition: abseil-cpp/absl/strings/substitute.h:129
absl::substitute_internal::Arg::Arg
Arg(unsigned long long value)
Definition: abseil-cpp/absl/strings/substitute.h:147
absl
Definition: abseil-cpp/absl/algorithm/algorithm.h:31
absl::Dec
Definition: abseil-cpp/absl/strings/str_cat.h:184
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
absl::numbers_internal::FastIntToBuffer
char * FastIntToBuffer(int32_t, char *)
Definition: abseil-cpp/absl/strings/numbers.cc:217
const_reference
const typedef T & const_reference
Definition: cxa_demangle.cpp:4831
absl::SubstituteAndAppend
void SubstituteAndAppend(std::string *output, absl::string_view format)
Definition: abseil-cpp/absl/strings/substitute.h:248
absl::substitute_internal::Arg::piece
absl::string_view piece() const
Definition: abseil-cpp/absl/strings/substitute.h:188
absl::substitute_internal::Arg::Arg
Arg(unsigned int value)
Definition: abseil-cpp/absl/strings/substitute.h:135


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:23