Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def add_templated():
# debug = open('debug.txt', 'a')
# debug.write('foo\n')
# debug.write('infile [' + cog.inFile + ']\n')
infile = cog.inFile
cppfile = infile.replace('.h','.cpp')
splitinfile = infile.replace('\\','/').split('/')
infilename = splitinfile[ len(splitinfile) - 1 ]
classname = infilename.replace('.h','')
# cog.outl('// classname: ' + classname)
# cog.outl('// cppfile: ' + infilename.replace('.h','.cpp'))
f = open(cppfile, 'r')
in_multiline_comment = False
in_header = False;
line = f.readline()
cog.outl('// generated, using cog:')
while(line != ''):
# cog.outl(line)
if(line.strip().find("/*") >= 0):
in_multiline_comment = True
if(line.strip().find("*/") >= 0):
def add(classname=''):
# debug = open('debug.txt', 'a')
# debug.write('foo\n')
# debug.write('infile [' + cog.inFile + ']\n')
infile = cog.inFile
splitinfile = infile.replace('\\','/').split('/')
infilename = splitinfile[ len(splitinfile) - 1 ]
if classname == '':
classname = infilename.replace('.h','')
cppfile = infile.replace('.h','.cpp')
# cog.outl('// classname: ' + classname)
# cog.outl('// cppfile: ' + infilename.replace('.h','.cpp'))
f = open(cppfile, 'r')
in_multiline_comment = False
in_header = False;
line = f.readline()
cog.outl('// generated, using cog:')
while(line != ''):
# cog.outl(line)
if(line.strip().find("/*") >= 0):
in_multiline_comment = True