| 271 | } |
| 272 | |
| 273 | static void RenameInDocs(const string& from, const string& to, |
| 274 | ApiDef* api_def) { |
| 275 | const string from_quoted = strings::StrCat("`", from, "`"); |
| 276 | const string to_quoted = strings::StrCat("`", to, "`"); |
| 277 | for (int i = 0; i < api_def->in_arg_size(); ++i) { |
| 278 | if (!api_def->in_arg(i).description().empty()) { |
| 279 | StringReplace(from_quoted, to_quoted, |
| 280 | api_def->mutable_in_arg(i)->mutable_description()); |
| 281 | } |
| 282 | } |
| 283 | for (int i = 0; i < api_def->out_arg_size(); ++i) { |
| 284 | if (!api_def->out_arg(i).description().empty()) { |
| 285 | StringReplace(from_quoted, to_quoted, |
| 286 | api_def->mutable_out_arg(i)->mutable_description()); |
| 287 | } |
| 288 | } |
| 289 | for (int i = 0; i < api_def->attr_size(); ++i) { |
| 290 | if (!api_def->attr(i).description().empty()) { |
| 291 | StringReplace(from_quoted, to_quoted, |
| 292 | api_def->mutable_attr(i)->mutable_description()); |
| 293 | } |
| 294 | } |
| 295 | if (!api_def->summary().empty()) { |
| 296 | StringReplace(from_quoted, to_quoted, api_def->mutable_summary()); |
| 297 | } |
| 298 | if (!api_def->description().empty()) { |
| 299 | StringReplace(from_quoted, to_quoted, api_def->mutable_description()); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | namespace { |
| 304 |
no test coverage detected