| 86 | } // namespace internal |
| 87 | |
| 88 | void 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 | |
| 112 | SubstituteArg::SubstituteArg(const void* value) { |
| 113 | COMPILE_ASSERT(sizeof(scratch_) >= sizeof(value) * 2 + 2, |
no test coverage detected