Skip to content

jeremt/cppgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

CppGen

It's a simple python script to generate c++ classes from .hh declaration.

Example

The following Test.hh file...

#ifndef TEST_H_
# define TEST_H_

class Test
{

private:

  std::string const _name;

public:

  Test(std::string const & name);
  ~Test();

public:

  std::string const & getName() const;

};

#endif

... generate the following output:

#include "Test.hh"

Test::Test(std::string const & name)
  : _name(name)
{
}

Test::~Test()
{
}

std::string const & Test::getName() const
{
  return _name;
}

Example

You can try the dog.hh example at the root of this repository :)

$ cppgen dog.hh > dog.cpp

TODO

  • The corresponding sublime text plugin
  • Do not generate pure virtual classes
  • Handle namespaces and multi-classes
  • Ideas ?

Bugs

About

Generate class into .cpp files from .hh files ;-).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors