| 37 | : StubGenerator(stubname, procedures, filename) {} |
| 38 | |
| 39 | void 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 | |
| 69 | void CPPClientStubGenerator::generateMethod(Procedure &proc) { |
| 70 | string procsignature = TEMPLATE_CPPCLIENT_SIGMETHOD; |
nothing calls this directly
no test coverage detected