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

Function _parse_signature

tools/xml2cpp-codegen/generator_utils.cpp:60–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58}
59
60static void _parse_signature(const std::string &signature, std::string &type, unsigned int &i, bool only_once = false)
61{
62 for (; i < signature.length(); ++i)
63 {
64 switch (signature[i])
65 {
66 case 'a':
67 {
68 switch (signature[++i])
69 {
70 case '{':
71 {
72 type += "std::map<";
73 ++i;
74 _parse_signature(signature, type, i);
75 type += ">";
76
77 break;
78 }
79 case '(':
80 {
81 type += "std::vector<sdbus::Struct<";
82 ++i;
83 _parse_signature(signature, type, i);
84 type += ">>";
85
86 break;
87 }
88 case '\0':
89 {
90 std::cerr <<
91 "Invalid array definition. Type is missing after '" << signature
92 << "'."
93 << std::endl;
94 exit(-1);
95 }
96
97 default:
98 {
99 type += "std::vector<";
100 _parse_signature(signature, type, i, true);
101
102 type += ">";
103
104 break;
105 }
106 }
107 break;
108 }
109 case '(':
110 {
111 type += "sdbus::Struct<";
112 ++i;
113
114 _parse_signature(signature, type, i);
115
116 type += ">";
117 break;

Callers 1

signature_to_typeFunction · 0.85

Calls 1

atomic_type_to_stringFunction · 0.85

Tested by

no test coverage detected