-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfind_headers.py
More file actions
26 lines (21 loc) · 806 Bytes
/
find_headers.py
File metadata and controls
26 lines (21 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import os
def find_hpp_files(directory):
hpp_files = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(".hpp"):
hpp_files.append(os.path.join(root, file))
return hpp_files
def generate_include_list(hpp_files):
include_list = [f'#include "{os.path.basename(file)}"' for file in hpp_files]
return include_list
if __name__ == "__main__":
target_directory = input("Enter the target directory: ")
hpp_files_list = find_hpp_files(target_directory)
if hpp_files_list:
include_list = generate_include_list(hpp_files_list)
print("Generated Include List:")
for include_statement in include_list:
print(include_statement)
else:
print("No .hpp files found.")