pygccxml.declarations.templates module

template instantiation parser

This module provides functionality necessary to

C++ template instantiations

args(decl_string)

returns list of template arguments

Return type:

[str]

is_instantiation(decl_string)

returns True if decl_string is template instantiation and False otherwise

Parameters:

decl_string (str) – string that should be checked for pattern presence

Return type:

bool

join(name_, args_)

returns name< argument_1, argument_2, …, argument_n >

name(decl_string)

returns name of instantiated template

Return type:

str

normalize(decl_string)

returns decl_string, which contains “normalized” spaces

this functionality allows to implement comparison of 2 different string which are actually same: x::y< z > and x::y<z>

normalize_full_name_false(decl)

Cached variant of normalize

Parameters:

decl (declaration.declaration_t) – the declaration

Returns:

normalized name

Return type:

str

normalize_full_name_true(decl)

Cached variant of normalize

Parameters:

decl (declaration.declaration_t) – the declaration

Returns:

normalized name

Return type:

str

normalize_name(decl)

Cached variant of normalize

Parameters:

decl (declaration.declaration_t) – the declaration

Returns:

normalized name

Return type:

str

normalize_partial_name(decl)

Cached variant of normalize

Parameters:

decl (declaration.declaration_t) – the declaration

Returns:

normalized name

Return type:

str

split(decl_string)

returns (name, [arguments] )

split_recursive(decl_string)

returns [(name, [arguments])]