File: tools.rst

package info (click to toggle)
cxxheaderparser 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,028 kB
  • sloc: python: 18,204; makefile: 33; sh: 9
file content (41 lines) | stat: -rw-r--r-- 905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Tools
=====

There are a variety of command line tools provided by the cxxheaderparser
project.

dump tool
---------

Dump data from a header to stdout

.. code-block:: sh

    # pprint format
    python -m cxxheaderparser myheader.h

    # JSON format
    python -m cxxheaderparser --mode=json myheader.h

    # dataclasses repr format
    python -m cxxheaderparser --mode=repr myheader.h

    # dataclasses repr format (formatted with black)
    python -m cxxheaderparser --mode=brepr myheader.h

Anything more than that and you should use the python API, start with the 
:ref:`simple API <simple>` first. 

test generator
--------------

To generate a unit test for cxxheaderparser:

* Put the C++ header content in a file
* Run the following:

.. code-block:: sh

    python -m cxxheaderparser.gentest FILENAME.h TESTNAME

You can copy/paste the stdout to one of the test files in the tests directory.