Sign in to follow this  

TinyXML question

This topic is 3102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am making a procedural Galaxy Engine for a game I am working on. I am going to be loading the information for each solar system through XML documents and I am using TinyXML. I am trying to get TinyXML setup and i was wondering if any one had any error checking code or could tell me what I would need so I can make sure it is loading the XML documents correctly? My code so far: #include "XMLParser.h" void XMLParser::LoadXML(const char* filetoload) { TiXmlDocument doc(filetoload); bool loadOkay = doc.LoadFile(); if (loadOkay) { } else { } } I know that the error checking code would go in the else statement but I have no clue what to put there.

Share this post


Link to post
Share on other sites
Well, what do you want to happen when there's an error? Print an error message? Exit the program? Try loading some "place-holder" file instead so the game can continue somewhat? Something else?

The answer, really, is "do whatever you have to do."

Share this post


Link to post
Share on other sites
Ok thanks. I decided for now I would just have it write some text to a text file. the XML files are loading just fine once I put the XML in the right folder.

Share this post


Link to post
Share on other sites

This topic is 3102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this