MCPcopy Create free account
hub / github.com/cinemast/libjson-rpc-cpp / generateStub

Method generateStub

src/stubgenerator/client/cppclientstubgenerator.cpp:39–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 : StubGenerator(stubname, procedures, filename) {}
38
39void CPPClientStubGenerator::generateStub() {
40 vector<string> classname = CPPHelper::splitPackages(this->stubname);
41 CPPHelper::prolog(*this, this->stubname);
42 this->writeLine("#include <jsonrpccpp/client.h>");
43 this->writeNewLine();
44
45 int depth = CPPHelper::namespaceOpen(*this, stubname);
46
47 this->writeLine(replaceAll(TEMPLATE_CPPCLIENT_SIGCLASS, "<stubname>", classname.at(classname.size() - 1)));
48 this->writeLine("{");
49 this->increaseIndentation();
50 this->writeLine("public:");
51 this->increaseIndentation();
52
53 this->writeLine(replaceAll(TEMPLATE_CPPCLIENT_SIGCONSTRUCTOR, "<stubname>", classname.at(classname.size() - 1)));
54 this->writeNewLine();
55
56 for (unsigned int i = 0; i < procedures.size(); i++) {
57 this->generateMethod(procedures[i]);
58 }
59
60 this->decreaseIndentation();
61 this->decreaseIndentation();
62 this->writeLine("};");
63 this->writeNewLine();
64
65 CPPHelper::namespaceClose(*this, depth);
66 CPPHelper::epilog(*this, this->stubname);
67}
68
69void CPPClientStubGenerator::generateMethod(Procedure &proc) {
70 string procsignature = TEMPLATE_CPPCLIENT_SIGMETHOD;

Callers

nothing calls this directly

Calls 6

generateMethodMethod · 0.95
writeLineMethod · 0.80
writeNewLineMethod · 0.80
sizeMethod · 0.80
increaseIndentationMethod · 0.80
decreaseIndentationMethod · 0.80

Tested by

no test coverage detected