code_generator
code_generator copied to clipboard
CppClass adds ": public" to class even though no parent is defined
I'm trying to generate a struct with out a parent and is getting the following result. the ": public" should not be there. Besides it looks a little strange with a extra newline between all variables.
python
test_class = CppClass(name="test", is_struct=True)
test_class.add_variable(CppVariable(name="foo", type="int"))
test_class.add_variable(CppVariable(name="bar", type="int"))
result
struct test : public
{
int foo;
int bar;
};
env
Python 3.10.12
Name: code-generation Version: 2.3.0 Summary: Provides functionality of generating source code programmatically Home-page: https://github.com/yuchdev/code_generator Author: Yurii Cherkasov Author-email: [email protected] License: Location: /home/dev/.local/lib/python3.10/site-packages Requires: pathlib Required-by: