def create_source_files(self, obj): builder = CppBuilder(self) filenames = self.get_missing_function_filenames(obj.get_functions()) for path, functions in filenames.items(): logging.warning("Creating file %s", path) with open(path, "w") as f: for fn in functions: f.write(builder.get_function_declaration(fn)) f.write("\n{\n\n}\n\n")
def check_functions(self, iterator): functions = iterator.get_functions() missing_filenames = self.get_missing_function_filenames(functions) if not missing_filenames: return if self.qit.auto_create_files: self.create_source_files(iterator) builder = CppBuilder(self) filenames = list(sorted(missing_filenames.keys())) functions = sum(missing_filenames.values(), []) message = "File(s) {} are required because " \ "of the following function(s):\n {}\n".format( ",".join(filenames), ",".join(builder.get_function_declaration(f) for f in functions)) raise MissingFiles(message, filenames)
def declarations(self, obj): builder = CppBuilder(self) return [builder.get_function_declaration(fn) for fn in obj.get_functions() if fn.is_external()]