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

Function PrintTree

codegen/test_proto_utils.cpp:27–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25using namespace phxrpc;
26
27void PrintTree(SyntaxTree * stree) {
28 printf("proto file %s\n", stree->GetProtoFile());
29 printf("prefix %s, name %s\n", stree->GetPrefix(), stree->GetName());
30
31 printf("\n");
32
33 SyntaxFuncVector * flist = stree->GetFuncList();
34 SyntaxFuncVector::iterator fit = flist->begin();
35 for (; flist->end() != fit; ++fit) {
36 printf("request %s, type %s\n", fit->GetReq()->GetName(), fit->GetReq()->GetType());
37 printf("response %s, type %s\n", fit->GetResp()->GetName(), fit->GetResp()->GetType());
38 printf("optstring %s, usage %s\n", fit->GetOptString(), fit->GetUsage());
39
40 printf("\n");
41 }
42}
43
44void test(const char * file) {
45 SyntaxTree stree;

Callers 1

testFunction · 0.85

Calls 9

GetProtoFileMethod · 0.80
GetNameMethod · 0.80
GetFuncListMethod · 0.80
GetReqMethod · 0.80
GetRespMethod · 0.80
GetOptStringMethod · 0.80
GetUsageMethod · 0.80
GetPrefixMethod · 0.45
GetTypeMethod · 0.45

Tested by

no test coverage detected