C++ Reading code from file

kirennia

Part of the furniture
Joined
Dec 26, 2003
Messages
3,857
Lo guys :)

I was just wondering if any of you know how to read code from a file. For example, setup a virtual class in order to create an object without knowing whats inside the methods, then read the methods from an external, non-compiled class which contains c++ code?

Would I have to instead create some sort of mediary reading class and just read a file as data or is there an easier way to just implement non-compiled c++ code through a .exe?
 

Tuthmes

FH is my second home
Joined
Jun 18, 2004
Messages
5,495
I believe you have to create it. Open TTD is (I think) a perfect example. where .grf files add extra objects to the core game. The whole game is written in C++ and they have to code a lot. But I really don t have any experiance with it. Would like to learn though!
 

kirennia

Part of the furniture
Joined
Dec 26, 2003
Messages
3,857
I'm just curious about it; doing my thesis atm, I'm trying to figure out the most productive way of implementing a plugin system, without sacrificing performance. It just seems logical to me... perhaps it's not the most cheat-proof of systems but being able to ... I don't know. For example, you want to recreate driving physics for a game... allow people to plugin their own driving models for acceleration, braking and steering. Whilst you're going to get a lot of crap, gems do emerge from plugin systems...just look at The Elder Scrolls. :)

Thanks for the example, I'll look into what can be done with that system and see if there's any logical way of doing it without spending too much time; it's very much a silver lining rather then a focus atm.
 

Wij

I am a FH squatter
Joined
Dec 23, 2003
Messages
18,404
If you're not going to compile the C++ then you certainly don't want to try interpreting it yourself. C++ interpreters do exist but I can't think of good uses for them.

http://www.softintegration.com/
 

Users who are viewing this thread

Top Bottom