Skip to content

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

Description

@grarup

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: strategarius@protonmail.com
License:
Location: /home/dev/.local/lib/python3.10/site-packages
Requires: pathlib
Required-by:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions