Skip to content

Commit

Permalink
📝 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Mattcrmx committed Jun 7, 2024
1 parent 28efeda commit 5976ff0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ parser = CyHeadGenParser()
my_func = "int super_func(int arg1, int *arg2);"
print(parser(my_func)) # [Function(name='super_func', type='int', parameters=[Argument(name='arg1', type='int', value=None), Argument(name='arg2', type='int*', value=None)])]
```

### Generation

The Generator is built on the two previous structures, and supports generating cython headers from an input string or
from a header file.
```python
from cyheadgen import CythonHeaderGenerator
cygen = CythonHeaderGenerator()

my_func = "int super_func(int arg1, int *arg2);"
print(cygen(my_func, header_name="toto.h")) # "int super_func(int arg1, int *arg2)"

print(cygen.generate_from_file(filepath="./toto.h"))
```

0 comments on commit 5976ff0

Please sign in to comment.