MCPcopy Create free account
hub / github.com/apache/impala / SubstituteAndAppend

Function SubstituteAndAppend

be/src/gutil/strings/substitute.cc:88–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86} // namespace internal
87
88void SubstituteAndAppend(
89 string* output, StringPiece format,
90 const SubstituteArg& arg0, const SubstituteArg& arg1,
91 const SubstituteArg& arg2, const SubstituteArg& arg3,
92 const SubstituteArg& arg4, const SubstituteArg& arg5,
93 const SubstituteArg& arg6, const SubstituteArg& arg7,
94 const SubstituteArg& arg8, const SubstituteArg& arg9) {
95 const SubstituteArg* const args_array[] = {
96 &arg0, &arg1, &arg2, &arg3, &arg4, &arg5, &arg6, &arg7, &arg8, &arg9, nullptr
97 };
98
99 // Determine total size needed.
100 int size = SubstitutedSize(format, args_array);
101 if (size == 0) return;
102
103 // Build the string.
104 int original_size = output->size();
105 STLStringResizeUninitialized(output, original_size + size);
106 char* target = string_as_array(output) + original_size;
107
108 target = SubstituteToBuffer(format, args_array, target);
109 DCHECK_EQ(target - output->data(), output->size());
110}
111
112SubstituteArg::SubstituteArg(const void* value) {
113 COMPILE_ASSERT(sizeof(scratch_) >= sizeof(value) * 2 + 2,

Callers 12

ToStringUnlockedMethod · 0.85
ToStringMethod · 0.85
ToStringMethod · 0.85
DelayedRetryCbMethod · 0.85
GetAllVersionInfoMethod · 0.85
WriteValueMethod · 0.85
WriteAsPrometheusMethod · 0.85
GetExitStatusMethod · 0.85
AppendXMLTagFunction · 0.85
GetOwnerThreadInfoMethod · 0.85
AppendValueAsJSONMethod · 0.85
SubstituteFunction · 0.85

Calls 6

SubstitutedSizeFunction · 0.85
string_as_arrayFunction · 0.85
SubstituteToBufferFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected