One of my programs generates a large file with c ++ code. Is there a way to call from another C ++ class to insert the generated code into it?
Here is a small example to make it clear what I am trying to achieve.
Generated file example:
FirstClass first = FirstClass();
first.add(*some data1*)
first.add(*some data2*)
...
first.add(*some dataN*)
SecondClass second = SecondClass();
second.add(*some data1*)
second.add(*some data2*)
...
second.add(*some dataM*)
Main example:
int main() {
std::string generated_file_path = ".../.../........./generated_file.txt";
do_cpp_code_from_file(generated_file_path); //this function is what I need
MyClass obj = MyClass();
obj.use(first, second); // I want to use generated objects
}
Is this possible?