Extends Bindgen's type parser to handle C++ templates, and adds methods that replace names in a given type with other types. This PR lays the groundwork for at least 2 scenarios:
Alias resolution, including in template arguments, e.g. from const QVector<QRgb> & to const QVector<unsigned int> &, provided QRgb is an alias for unsigned int. This can be used for the first issue mentioned in #102; before this PR, the most Bindgen could do was resolving one level of aliases in each template argument.
Template type substitution, e.g. QVector<const T *> to QVector<const QVector<int> *>, provided T is instantiated with const QVector<int> & (notice the combination of const-ness and references and pointers). This allows for example the possibility of defining container interfaces in the config files.
The parser and the substitution both fully handle arbitrarily nested templates; the returned Parser::Types respect the template structure at all levels, and should match what would be produced by the Clang parser.
Extends Bindgen's type parser to handle C++ templates, and adds methods that replace names in a given type with other types. This PR lays the groundwork for at least 2 scenarios:
const QVector<QRgb> &
toconst QVector<unsigned int> &
, providedQRgb
is an alias forunsigned int
. This can be used for the first issue mentioned in #102; before this PR, the most Bindgen could do was resolving one level of aliases in each template argument.QVector<const T *>
toQVector<const QVector<int> *>
, providedT
is instantiated withconst QVector<int> &
(notice the combination of const-ness and references and pointers). This allows for example the possibility of defining container interfaces in the config files.The parser and the substitution both fully handle arbitrarily nested templates; the returned
Parser::Type
s respect the template structure at all levels, and should match what would be produced by the Clang parser.