1
0

refactor: change bmap binding generator name, layout for future refactor

This commit is contained in:
2026-01-27 20:58:29 +08:00
parent f601782370
commit 3152d7dd52
36 changed files with 395 additions and 220 deletions

View File

@@ -0,0 +1,24 @@
import os, re
def main():
self_path: str = os.path.dirname(__file__)
src_file: str = os.path.join(self_path, '../../BMap/BMExports.hpp')
dst_file: str = os.path.join(self_path, 'dest/BMExports.hpp')
with open(src_file, 'r', encoding='utf-8') as fsrc:
# read full text
fulltext: str = fsrc.read()
# do findall and write into file
with open(dst_file, 'w', encoding='utf-8') as fdst:
# We should not only match BMAP_EXPORT,
# because it may match the defination of BMAP_EXPORT.
# So we add a bool at head because all BMap functions return bool.
for item in re.findall('^BMAP_EXPORT[ \\t]+bool[ \\t]+[^;]+;', fulltext, re.MULTILINE):
fdst.write(item)
fdst.write('\n')
print('DONE')
if __name__ == "__main__":
main()