diff --git a/tools/generator_utils.cpp b/tools/generator_utils.cpp index 3c121af..c984959 100644 --- a/tools/generator_utils.cpp +++ b/tools/generator_utils.cpp @@ -122,11 +122,11 @@ void _parse_signature(const string &signature, string &type, unsigned int &i) type += "std::vector< "; _parse_signature(signature, type, i); - type += " >"; + type += " >"; break; } - } + } if (i+1 < signature.length() && signature[i+1] != ')' && signature[i+1] != '}') { @@ -154,105 +154,13 @@ void _parse_signature(const string &signature, string &type, unsigned int &i) { type += ", "; } + break; } } } } -/*{ - for (; i < signature.length(); ++i) - { - cout << "i: " << i << ", sig(i): " << signature[i] << endl; - cout << "Type: " << type << endl; - - switch (signature[i]) - { - case 'a': - { - bool multi = false; - switch (signature[++i]) - { - case '{': - { - type += "std::map< "; - - const char *atom = atomic_type_to_string(signature[++i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - type += ", "; - ++i; - _parse_signature(signature, type, i); - multi = true; - break; - } - default: - { - type += "std::vector< "; - _parse_signature(signature, type, i); - type += " >V"; - multi = true; - break; - } - } - if (!multi) - { - _parse_signature(signature, type, i); - } - cout << "signature1: " << signature << endl; - cout << "type1: " << type << endl; - cout << "i1: " << i << ", sig(i): " << signature[i-1] << endl; - - continue; - } - case '(': - { - type += "::DBus::Struct< "; - ++i; - _parse_signature(signature, type, i); - type += " >S"; - cout << "signature2: " << signature << endl; - cout << "type2: " << type << endl; - cout << "i2: " << i << ", sig(i): " << signature[i] << endl; - if ((i+1 < signature.length()) && (signature[i+1] != ')') ) - { - type += ", "; - } - continue; - } - case ')': - case '}': - { - type += " >?"; - cout << "close tag>" << endl; - cout << "type3: " << type << endl; - - return; - } - default: - { - const char *atom = atomic_type_to_string(signature[i]); - if (!atom) - { - cerr << "invalid signature" << endl; - exit(-1); - } - type += atom; - - if (i+1 < signature.length() && signature[i+1] != ')' && signature[i+1] != '}') - { - type += ", "; - } - break; - } - } - } -}*/ - string signature_to_type(const string &signature) { string type;