MCPcopy Create free account
hub / github.com/Kistler-Group/sdbus-cpp / generateNamespaces

Method generateNamespaces

tools/xml2cpp-codegen/BaseGenerator.cpp:88–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88std::tuple<unsigned, std::string> BaseGenerator::generateNamespaces(const std::string& ifaceName) const
89{
90 std::stringstream ss{ifaceName};
91 std::ostringstream body;
92 unsigned count{0};
93
94 // prints the namespaces X and Y defined with <interface name="X.Y.Z">
95 while (ss.str().find('.', ss.tellg()) != std::string::npos)
96 {
97 std::string nspace;
98 getline(ss, nspace, '.');
99 nspace = mangle_name(nspace);
100 body << "namespace " << nspace << " {" << endl;
101 ++count;
102 }
103 body << endl;
104
105 return std::make_tuple(count, body.str());
106}
107
108
109std::tuple<std::string, std::string, std::string, std::string> BaseGenerator::argsToNamesAndTypes(const Nodes& args, bool async) const

Callers

nothing calls this directly

Calls 1

mangle_nameFunction · 0.85

Tested by

no test coverage detected