≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
createIrrXMLReader( ) on non-existing files
Posted by:
(you are not logged in)
Enter the missing letter in: "Internation?l"
(you are not logged in)
Text:
[quote][b]dswain[/b] wrote: 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: [code] IrrXMLReader* xml = createIrrXMLReader( xmlFile ); cout << xmlFile << "\n"; cout << &xml << "\n"; if ( !xml ) { cerr << "ERROR - Unable to open XML file.\n"; return 2; } [/code] On a good run: [code] [dmv45@ash copper]$ ./copper sample.xml sample.xml 0xbf987574 (more proper output) [/code] On what should be a bad run: [code] [dmv45@ash copper]$ ./copper sampjfdshfhhsd_file_doesn't_exist sampjfdshfhhsd 0xbf90fcf4 (more output that shouldn't be seen) [/code] 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![/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact