while( reader->read() );
The trailing semicolon means that none of the following code is executed until the while loop is finished. So it was reading through the whole file and then never getting to my switch statement :s
Sometimes you just need another pair of eyes.
Anyway, I had fun implementing my own parser and learned a lot. I learned that using the scanf family of functions is unsafe!
INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
And here is a safe, compliant solution:
INT06-C. Use strtol() or a related function to convert a string token to an integer
I'm going to use XML though, because of the convenience of irr::io::IAttributes
It provides a whole host of functions that will really come in handy once my save files grow to sufficient complexity.
No comments:
Post a Comment