Commit 2a29de4c authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#859 Script create_accessors: the class data attributes was not used...

#859 Script create_accessors: the class data attributes was not used consistently everywhere, and therefore proposed output could be incorrect for few lines due to missing trailing underscore.
parent 1267d982
import os
import shutil
folder = "XCodeTemplates"
for root, dirs, files in os.walk(folder):
for myfile in files:
if myfile.endswith(".hpp") or myfile.endswith(".hxx") or myfile.endswith(".cpp"):
filename = os.path.join(root, myfile)
FILE_in = open(filename)
tmp = "{0}.tmp".format(filename)
FILE_out = open(tmp, 'w')
FILE_out.write("//! \\file \n//\n")
for line in FILE_in:
FILE_out.write(line)
FILE_in.close()
FILE_out.close()
os.remove(filename)
shutil.copyfile(tmp, filename)
......@@ -238,13 +238,10 @@ class SmartPtr(CreateAccessors):
CreateAccessors.__init__(self, template_args, class_name, typename, attribute_name, dox_comment, Nchar_max = Nchar_max, is_constant = False)
local = attribute_name[:-1]
local = self._attribute_name[:-1]
print(" * \param[in] {local} {dox}\n".format(local = local, dox = self._PrintComment(dox_comment, with_delimiters = False, shift_first_line = len(local) + 7)))
print("{attr} = std::make_unique<{type}>();".format(attr = attribute_name, \
print("{attr} = std::make_unique<{type}>();".format(attr = self._attribute_name, \
type = typename))
def _ConstantAccessorDefinitionContent(self):
......@@ -270,10 +267,10 @@ class Reference(CreateAccessors):
self._const_preffix = self._is_constant and "const " or ''
CreateAccessors.__init__(self, template_args, class_name, typename, attribute_name, dox_comment, is_const, Nchar_max)
local = attribute_name[:-1]
local = self._attribute_name[:-1]
print("* \param[in] {local} {dox}\n".format(local = local, dox = self._PrintComment(dox_comment, with_delimiters = False, shift_first_line = len(local))))
print("{const}{type}& {local},\n".format(const = self._const_preffix, type = typename, local = local))
print("{attr}({local}),".format(local = local, attr = attribute_name))
print("{attr}({local}),".format(local = local, attr = self._attribute_name))
def _DataAttributeStorage(self):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment