Commit 81dfef36 authored by Joe Snyder's avatar Joe Snyder
Browse files

Add default namespace parameter

Add an new argument to the generator which will start to parse
the XML data assuming that namespace contains all classes and information.
parent 7c8efd34
......@@ -39,10 +39,13 @@ The Python script has help for the arguments::
Path to input JSON file of namespaces
-g CASTXML_PATH, --castxml-path CASTXML_PATH
Path to castxml
-d DEFAULT_NAMESPACE, --default_namespace DEFAULT_NAMESPACE
value to use as the default namespace
--includes INCLUDES, -i INCLUDES
Path to the includes directory.
--no-generation, -n Only print name of files to be generated
To run over the entirety of the local example, we use a command like this::
$ python3 generator.py -g ~/Work/TRI/CastXML/build/bin/castxml -s ~/Work/TRI/wrapper_generator/example/
......
......@@ -241,7 +241,10 @@ def parse(options):
pygccxml.utils.loggers.cxx_parser.setLevel(logging.CRITICAL)
pygccxml.declarations.scopedef_t.RECURSIVE_DEFAULT = False
pygccxml.declarations.scopedef_t.ALLOW_EMPTY_MDECL_WRAPPER = True
name_data = total[0] #.namespace("drake")
name_data = total[0]
if options.default_namespace:
name_data = total[0].namespace(options.default_namespace)
for declared_class in results['decls']:
print(declared_class)
if declared_class in [x.name for x in total[0].classes()]:
......@@ -274,6 +277,13 @@ arg.add_argument(
dest="castxml_path",
help="Path to castxml",
required=True)
arg.add_argument(
"-d",
"--default_namespace",
action="store",
dest="default_namespace",
help="value to use as the default namespace",
required=False)
arg.add_argument('--includes', '-i', type=str,
help='Path to the includes directory.',
action="append",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment