| 1 |
Tools |
| 2 |
===== |
| 3 |
|
| 4 |
There are a variety of command line tools provided by the cxxheaderparser |
| 5 |
project. |
| 6 |
|
| 7 |
dump tool |
| 8 |
--------- |
| 9 |
|
| 10 |
Dump data from a header to stdout |
| 11 |
|
| 12 |
.. code-block:: sh |
| 13 |
|
| 14 |
# pprint format |
| 15 |
python -m cxxheaderparser myheader.h |
| 16 |
|
| 17 |
# JSON format |
| 18 |
python -m cxxheaderparser --mode=json myheader.h |
| 19 |
|
| 20 |
# dataclasses repr format |
| 21 |
python -m cxxheaderparser --mode=repr myheader.h |
| 22 |
|
| 23 |
# dataclasses repr format (formatted with black) |
| 24 |
python -m cxxheaderparser --mode=brepr myheader.h |
| 25 |
|
| 26 |
Anything more than that and you should use the python API, start with the |
| 27 |
:ref:`simple API <simple>` first. |
| 28 |
|
| 29 |
test generator |
| 30 |
-------------- |
| 31 |
|
| 32 |
To generate a unit test for cxxheaderparser: |
| 33 |
|
| 34 |
* Put the C++ header content in a file |
| 35 |
* Run the following: |
| 36 |
|
| 37 |
.. code-block:: sh |
| 38 |
|
| 39 |
python -m cxxheaderparser.gentest FILENAME.h TESTNAME |
| 40 |
|
| 41 |
You can copy/paste the stdout to one of the test files in the tests directory. |