code_generator icon indicating copy to clipboard operation
code_generator copied to clipboard

CppClass adds ": public" to class even though no parent is defined

Open grarup opened this issue 1 year ago • 0 comments

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:

grarup avatar May 21 '24 11:05 grarup