def _create_csv(self, filename, data):
csv_id = 0
if not self._parser.quiet:
print("Creating csv on file '%s'" % filename)
with open(filename, self._option_open_file) as csv_file:
result = csv.writer(csv_file, delimiter=';', quotechar="", quoting=csv.QUOTE_NONE)
result.writerow(self._header)
for clang_obj in data:
if clang_obj.kind in [clang.cindex.CursorKind.CLASS_DECL, clang.cindex.CursorKind.CLASS_TEMPLATE]:
# class section
for clang_obj_child in clang_obj.methods:
self.add_line(result, clang_obj, clang_obj_child, csv_id)
csv_id += 1
else:
# method of function section
self.add_line(result, None, clang_obj, csv_id)
csv_id += 1
if not self._parser.quiet:
print("%s row into %s" % (csv_id, filename))
评论列表
文章目录