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

Function SubstituteToBuffer

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

Source from the content-addressed store, hash-verified

63}
64
65char* SubstituteToBuffer(StringPiece format,
66 const SubstituteArg* const* args_array,
67 char* target) {
68 for (int i = 0; i < format.size(); i++) {
69 if (format[i] == '$') {
70 if (ascii_isdigit(format[i+1])) {
71 const SubstituteArg* src = args_array[format[i+1] - '0'];
72 memcpy(target, src->data(), src->size());
73 target += src->size();
74 ++i; // Skip next char.
75 } else if (format[i+1] == '$') {
76 *target++ = '$';
77 ++i; // Skip next char.
78 }
79 } else {
80 *target++ = format[i];
81 }
82 }
83 return target;
84}
85
86} // namespace internal
87

Callers 2

SubstituteAndTraceMethod · 0.85
SubstituteAndAppendFunction · 0.85

Calls 3

ascii_isdigitFunction · 0.85
sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected