| 110 | } |
| 111 | |
| 112 | void ClientCodeRender::GetStubFuncDeclaration(const SyntaxTree *const stree, const SyntaxFunc *const func, |
| 113 | int is_header, string *result) { |
| 114 | char class_name[128]{'\0'}, type_name[128]{'\0'}; |
| 115 | |
| 116 | name_render_.GetStubClassName(stree->GetName(), class_name, sizeof(class_name)); |
| 117 | |
| 118 | if (is_header) { |
| 119 | phxrpc::StrAppendFormat(result, "int %s(", func->GetName()); |
| 120 | } else { |
| 121 | phxrpc::StrAppendFormat(result, "int %s::%s(", class_name, func->GetName()); |
| 122 | } |
| 123 | |
| 124 | name_render_.GetMessageClassName(func->GetReq()->GetType(), type_name, sizeof(type_name)); |
| 125 | phxrpc::StrAppendFormat(result, "const %s &req,\n", type_name); |
| 126 | |
| 127 | name_render_.GetMessageClassName(func->GetResp()->GetType(), type_name, sizeof(type_name)); |
| 128 | phxrpc::StrAppendFormat(result, " %s *resp", type_name); |
| 129 | |
| 130 | phxrpc::StrAppendFormat(result, ")"); |
| 131 | } |
| 132 | |
| 133 | void ClientCodeRender::GenerateStubCpp(SyntaxTree *stree, FILE *write) { |
| 134 | char file_name[128]{'\0'}; |
nothing calls this directly
no test coverage detected