Firstly, thanks for irrXML. It's been great thus far with documentation that actually helps and examples that actually make sense. Pretty sweet change of pace.
My issue right now is when creating the reader on a non-existing file. While it might be safe to assume that they won't enter the file name wrong, I'd rather not take that chance. Here's what I'm doing:
IrrXMLReader* xml = createIrrXMLReader( xmlFile ); cout << xmlFile << "\n"; cout << &xml << "\n";
if ( !xml ) { cerr << "ERROR - Unable to open XML file.\n"; return 2; }
On a good run:
[dmv45@ash copper]$ ./copper sample.xml sample.xml 0xbf987574 (more proper output)
On what should be a bad run:
[dmv45@ash copper]$ ./copper sampjfdshfhhsd_file_doesn't_exist sampjfdshfhhsd 0xbf90fcf4 (more output that shouldn't be seen)
Looking at irrXML.cpp, it seems like there's no particular way to catch to return that something went wrong (from the constructor at least) but the API says it should return 0 on a failure. Do I need to check the files existence myself?
Thanks in advance!
|