File¶
- class ccg.File(declarations, style=<ccg.style.Style object>)¶
Bases:
objectFile Object
- Parameters
declarations (Union[CDeclarations, List[CDeclaration]]) –
style (Style) –
- generate(path, auto_create_folders=True)¶
Generate code in path
- Parameters
path (str) – path of the file to generate
auto_create_folders (bool) – if true, if the path specified does not exist, will create the folder tree required
- Return type
None
- class ccg.UserSection(identifier, default_content='\n')¶
Bases:
ccg.statements.Cstatement.CDeclarationUser Section
- Allows creating sections in a file where the user can edit the file
and the generation of code will not overwrite those changes
Note
- Inherits from declaration since it can be on the outer scope of a file, or as a statement inside the
contents of a function for example (that contains statements, but declaration inherits from statement)
- Parameters
identifier (str) –
default_content (str) –