updated README.md formatting

This commit is contained in:
hbristow 2013-08-28 17:58:08 +10:00
parent 2a0e357cd0
commit 569e8006e3

View File

@ -287,16 +287,16 @@ build_info has the following call signature:
To build a parse tree, first parse a set of headers, then invoke the parse tree to refactor the output: To build a parse tree, first parse a set of headers, then invoke the parse tree to refactor the output:
```python ```python
# parse a set of definitions into a dictionary of namespaces # parse a set of definitions into a dictionary of namespaces
parser = CppHeaderParser() parser = CppHeaderParser()
ns['core'] = parser.parse('path/to/opencv/core.hpp') ns['core'] = parser.parse('path/to/opencv/core.hpp')
# refactor into a semantic tree # refactor into a semantic tree
parse_tree = ParseTree() parse_tree = ParseTree()
parse_tree.build(ns) parse_tree.build(ns)
# iterate over the tree # iterate over the tree
for namespace in parse_tree.namespaces: for namespace in parse_tree.namespaces:
for clss in namespace.classes: for clss in namespace.classes:
# do stuff # do stuff
for method in namespace.methods: for method in namespace.methods:
@ -331,7 +331,6 @@ mat.isClass();
mat.className(); mat.className();
mat.real(); mat.real();
mat.imag(); mat.imag();
etc…
``` ```
The MxArray object uses scoped memory management. If you wish to pass an MxArray back to Matlab (as a lhs pointer), you need to explicitly release ownership of the array so that it is not destroyed when it leaves scope: The MxArray object uses scoped memory management. If you wish to pass an MxArray back to Matlab (as a lhs pointer), you need to explicitly release ownership of the array so that it is not destroyed when it leaves scope: