|
|
|
@ -147,69 +147,93 @@ static bool parseDBusSignature(const TQString& signature, Argument& argument)
|
|
|
|
|
if (from == -1 || to == -1 || (to - from - 1) < 2) return false;
|
|
|
|
|
|
|
|
|
|
TQString dictSignature = signature.mid(from + 1, (to - from - 1));
|
|
|
|
|
|
|
|
|
|
Argument key;
|
|
|
|
|
if (!parseDBusSignature(dictSignature.left(1), key)) return false;
|
|
|
|
|
|
|
|
|
|
Argument value;
|
|
|
|
|
if (parseDBusSignature(dictSignature.mid(1), value))
|
|
|
|
|
{
|
|
|
|
|
if (!value.subAccessor.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K> class TQT_DBusDataMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQMap< " + key.signature +
|
|
|
|
|
", " + value.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
argument.subAccessor = value.accessor + "Map";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K, typename V> class TQMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
argument.forwardDeclarations += value.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["TQt"].append("<tqmap.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
|
|
|
|
|
TQMap<TQString, TQStringList>::const_iterator it =
|
|
|
|
|
value.sourceIncludes.begin();
|
|
|
|
|
TQMap<TQString, TQStringList>::const_iterator endIt =
|
|
|
|
|
value.sourceIncludes.end();
|
|
|
|
|
for (; it != endIt; ++it)
|
|
|
|
|
{
|
|
|
|
|
argument.sourceIncludes[it.key()] += it.data();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K> class TQT_DBusDataMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
}
|
|
|
|
|
if (dictSignature.startsWith("oa")) {
|
|
|
|
|
argument.signature = "TQT_DBusData";
|
|
|
|
|
argument.accessor = "ObjectPathKeyMap";
|
|
|
|
|
argument.subAccessor = "StringKeyMapMap";
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("class TQT_DBusData");
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
|
|
|
|
|
Argument key;
|
|
|
|
|
if (!parseDBusSignature(dictSignature.left(1), key)) return false;
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append( "template <typename K> class TQT_DBusDataMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
} else {
|
|
|
|
|
Argument key;
|
|
|
|
|
if (!parseDBusSignature(dictSignature.left(1), key)) return false;
|
|
|
|
|
|
|
|
|
|
Argument value;
|
|
|
|
|
if (parseDBusSignature(dictSignature.mid(1), value))
|
|
|
|
|
{
|
|
|
|
|
if (!value.subAccessor.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K> class TQT_DBusDataMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQMap< " + key.signature +
|
|
|
|
|
", " + value.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
argument.subAccessor = value.accessor + "Map";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K, typename V> class TQMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
argument.forwardDeclarations += value.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["TQt"].append("<tqmap.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
|
|
|
|
|
TQMap<TQString, TQStringList>::const_iterator it =
|
|
|
|
|
value.sourceIncludes.begin();
|
|
|
|
|
TQMap<TQString, TQStringList>::const_iterator endIt =
|
|
|
|
|
value.sourceIncludes.end();
|
|
|
|
|
for (; it != endIt; ++it)
|
|
|
|
|
{
|
|
|
|
|
argument.sourceIncludes[it.key()] += it.data();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
argument.isPrimitive = false;
|
|
|
|
|
argument.containerClass = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.signature = "TQT_DBusDataMap< " + key.signature + " >";
|
|
|
|
|
argument.accessor = key.accessor + "KeyMap";
|
|
|
|
|
|
|
|
|
|
argument.forwardDeclarations.append("template <typename K> class TQT_DBusDataMap");
|
|
|
|
|
argument.forwardDeclarations += key.forwardDeclarations;
|
|
|
|
|
|
|
|
|
|
argument.sourceIncludes = key.sourceIncludes;
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdata.h>");
|
|
|
|
|
argument.sourceIncludes["tqdbus"].append("<tqdbusdatamap.h>");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|