@@ -22,7 +22,7 @@ a reference to an integer. More over, I want those functions names to end with
22
22
query = query & ~ declarations.access_type_matcher_t( ' public' )
23
23
global_ns.member_functions( function = query, arg_types = [None , ' int &' ] )
24
24
25
- The example is complex , but still readable. In many cases you will find
25
+ The example is complex , but still readable. In many cases you will find
26
26
yourself, looking for one or many declarations, using one or two declaration properties.
27
27
For example:
28
28
@@ -38,11 +38,16 @@ User interface
38
38
39
39
As you already know, `` pygccxml.declarations`` package defines the following classes:
40
40
41
- * `` scopedef_t`` - base class for all classes, that can contain other declarations
41
+ * :class :`scopedef_t < pygccxml.declarations.scopedef.scopedef_t> ` - base class
42
+ for all classes, that can contain other declarations
42
43
43
- * `` namespace_t`` - derives from `` scopedef_t`` class , represents C++ namespace
44
+ * :class :`namespace_t < pygccxml.declarations.namespace.namespace_t> ` - derives
45
+ from :class :`scopedef_t < pygccxml.declarations.scopedef.scopedef_t> ` class ,
46
+ represents C++ namespace
44
47
45
- * `` class_t`` - derives from `` scopedef_t`` class , represents C++ class / struct/ union.
48
+ * :class :`class_t < pygccxml.declarations.class_declaration.class_t> ` - derives
49
+ from :class :`scopedef_t < pygccxml.declarations.scopedef.scopedef_t> ` class ,
50
+ represents C++ class / struct/ union.
46
51
47
52
So, the query methods defined on `` scopedef_t`` class could be used on instances
48
53
of `` class_t`` and `` namespace_t`` classes. I am sure you knew that.
@@ -64,9 +69,9 @@ methods:
64
69
header_dir = None ,
65
70
header_file = None ,
66
71
recursive = None )
67
-
72
+
68
73
mem_fun = member_function # just an alias
69
-
74
+
70
75
def member_functions( self ,
71
76
name = None ,
72
77
function = None ,
@@ -76,7 +81,7 @@ methods:
76
81
header_file = None ,
77
82
recursive = None ,
78
83
allow_empty = None )
79
- mem_funs = member_functions
84
+ mem_funs = member_functions
80
85
81
86
82
87
As you can see, from the method arguments you can search for member function
@@ -106,13 +111,13 @@ by:
106
111
107
112
* `` return_type``
108
113
109
- the function return type . This argument can be string or an object that describes
114
+ the function return type . This argument can be string or an object that describes
110
115
C++ type .
111
116
112
117
.. code- block:: python
113
118
114
119
mem_funcs = my_class.member_functions( return_type = ' int' )
115
-
120
+
116
121
i = declarations.int_t()
117
122
ref_i = declarations.reference_t( i )
118
123
const_ref_i = declarations.const_t( ref_i )
128
133
129
134
.. code- block:: python
130
135
131
- mem_funcs = my_class.member_functions( arg_types = [ None , ' int' ] )
136
+ mem_funcs = my_class.member_functions( arg_types = [ None , ' int' ] )
132
137
133
138
`` mem_funcs`` will contain all member functions, which have two arguments
134
139
and type of second argument is `` int `` .
@@ -286,10 +291,8 @@ query method, you can take a look on API documentation or into source code.
286
291
.. _`call policies` : http:// boost.org/ libs/ python/ doc/ tutorial/ doc/ html/ python/ functions.html# python.call_policies
287
292
.. _`Call policies` : http:// boost.org/ libs/ python/ doc/ tutorial/ doc/ html/ python/ functions.html# python.call_policies
288
293
289
- .. _`SourceForge` : http:// sourceforge.net/ index.php
290
294
.. _`Python` : http:// www.python.org
291
295
.. _`GCC - XML ` : http:// www.gccxml.org
292
296
.. _`UML diagram` : declarations_uml.png
293
297
.. _`parser package UML diagram` : parser_uml.png
294
- .. _`ReleaseForge` : http:// releaseforge.sourceforge.net
295
298
.. _`boost::type_traits` : http:// www.boost.org/ libs/ type_traits/ index.html
0 commit comments