Well your code is almost identical to what i have. That being said my problem was not being able to have a generic data type that would cast whichever data type column has. |
Yeah I thought so...
I don't have any ideas besides that
The only thing that comes to my mind is to hide the implementation but in C/C++ you have to know the types at compile time so you have to do something like that somewhere...
The only other thing that comes to my mind is you could make it 2 programs, 1 that parses the text and then recompiles the other one and the other one is a template that's easy to manipulate to fit your needs...
Then you could reread the file in the second program...
Yeah, I know, I'm out of ideas....
if possible you should use a scripting language, they are the right tools for your task but I guess that's not an option?
i'll just use string for all kinds of data which may increase memory usage but i guess typename isn't too big of a deal as long as i know what the data will be used for. |
The other problem is the other side has to know what kind of data you send, right?
You'll have some functions like WriteInt16 or WriteFloat or ReadInt16 or WriteFloat.
So as