Go to the documentation of this file.
15 #include "absl/strings/substitute.h"
19 #include "absl/base/internal/raw_logging.h"
20 #include "absl/strings/ascii.h"
21 #include "absl/strings/escaping.h"
22 #include "absl/strings/internal/resize_uninitialized.h"
23 #include "absl/strings/string_view.h"
27 namespace substitute_internal {
34 for (
size_t i = 0;
i <
format.size();
i++) {
36 if (i + 1 >=
format.size()) {
39 "Invalid absl::Substitute() format string: \"%s\".",
45 if (
static_cast<size_t>(
index) >= num_args) {
49 "Invalid absl::Substitute() format string: asked for \"$"
50 "%d\", but only %d args were given. Full format string was: "
58 }
else if (
format[i + 1] ==
'$') {
64 "Invalid absl::Substitute() format string: \"%s\".",
74 if (
size == 0)
return;
77 size_t original_size =
output->size();
79 char*
target = &(*output)[original_size];
80 for (
size_t i = 0;
i <
format.size();
i++) {
86 }
else if (
format[i + 1] ==
'$') {
100 "fix sizeof(scratch_)");
101 if (
value ==
nullptr) {
124 }
while (
value != 0);
129 std::fill_n(beg,
writer - beg,
hex.fill);
141 char*
const minfill =
end - dec.width;
152 ptrdiff_t fillers =
writer - minfill;
156 bool add_sign_again =
false;
157 if (neg && dec.fill ==
'0') {
159 add_sign_again =
true;
162 std::fill_n(
writer, fillers, dec.fill);
163 if (add_sign_again) *--
writer =
'-';
static int copy(grpc_slice_buffer *input, grpc_slice_buffer *output)
std::string CEscape(absl::string_view src)
#define ABSL_NAMESPACE_END
#define ABSL_NAMESPACE_BEGIN
constexpr size_type size() const noexcept
def c_str(s, encoding='ascii')
unsigned __int64 uint64_t
constexpr const_iterator begin() const noexcept
void SubstituteAndAppendArray(std::string *output, absl::string_view format, const absl::string_view *args_array, size_t num_args)
char scratch_[numbers_internal::kFastToBufferSize]
_W64 unsigned int uintptr_t
void STLStringResizeUninitialized(string_type *s, size_t new_size)
absl::string_view string_view
ABSL_CONST_INIT const ABSL_DLL char kHexChar[]
static const int kFastToBufferSize
bool ascii_isdigit(unsigned char c)
constexpr const_iterator end() const noexcept
#define ABSL_RAW_LOG(severity,...)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:23