MCPcopy Create free account
hub / github.com/Tencent/phxrpc / GenerateClientEtc

Method GenerateClientEtc

codegen/client_code_render.cpp:390–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390void ClientCodeRender::GenerateClientEtc(SyntaxTree *stree, FILE *write) {
391 char etc_file[128]{'\0'};
392 name_render_.GetClientEtcFileName(stree->GetName(), etc_file, sizeof(etc_file));
393
394 string buffer;
395 name_render_.GetCopyright("phxrpc_pb2server", stree->GetProtoFile(), &buffer, false, "#");
396
397 fprintf(write, "# %s\n", etc_file);
398 fprintf(write, "%s", buffer.c_str());
399 fprintf(write, "#\n");
400 fprintf(write, "\n");
401
402 string content(PHXRPC_CLIENT_ETC_TEMPLATE);
403 StrTrim(&content);
404 StrReplaceAll(&content, "$PackageName$", stree->GetPackageName() );
405 fprintf(write, "%s", content.c_str());
406
407 fprintf(write, "\n");
408 fprintf(write, "\n");
409}
410

Callers 1

Proto2ClientFunction · 0.80

Calls 7

StrTrimFunction · 0.85
StrReplaceAllFunction · 0.85
GetClientEtcFileNameMethod · 0.80
GetNameMethod · 0.80
GetCopyrightMethod · 0.80
GetProtoFileMethod · 0.80
GetPackageNameMethod · 0.45

Tested by

no test coverage detected