File Reflection Tool
2025
File Reflection Tool
2025
Description
This project uses Clang LLVM to reflect files and generate code to set up reflection data that exposes objects, variables and functions.
This allows a program to dynamically read and call these functions. This is useful for scripting as data containers such as classes and structs can now be read and modified.
Clang
The Clang project provides a language front-end and tooling infrastructure for languages in the C language family (C, C++, Objective C/C++, OpenCL, and CUDA) for the LLVM project.
I choose Clang instead of other tools as it is gives more information, faster compilation, more detailed error reports.
Starting the program the program will search the targeted folder and find all designated files (.h, .hpp).
Given a file the reflector will look for if the class is a component and developers macros for what to reflect.
A reflected class will reflect all public information.
Once the reflector has processed every file, a file is created were it populate it with the reflected information for a program it was intended for.
Names are hashed into unsigned int as ID.