Started on common and core packages.
This commit is contained in:
16
scripts/newcpp
Executable file
16
scripts/newcpp
Executable file
@ -0,0 +1,16 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
sys.exit(1)
|
||||
|
||||
pkg = sys.argv[1]
|
||||
name = sys.argv[2]
|
||||
ifdef = "WOMBAT_%s_%s_HPP" % (pkg.upper(), name.upper())
|
||||
namespace = "namespace wombat {\nnamespace %s {\n\n}\n}" % pkg
|
||||
hpp = "#ifndef %s\n#define %s\n\n%s\n\n#endif" % (ifdef, ifdef, namespace)
|
||||
cpp = "#include \"%s.hpp\"\n\n%s" % (name, namespace)
|
||||
|
||||
open("src/%s/%s.hpp" % (pkg, name), "w").write(hpp)
|
||||
open("src/%s/%s.cpp" % (pkg, name), "w").write(cpp)
|
Reference in New Issue
Block a user