| 212 | } |
| 213 | |
| 214 | void X3DImporter::ParseFile(const std::string &file, IOSystem *pIOHandler) { |
| 215 | ai_assert(nullptr != pIOHandler); |
| 216 | |
| 217 | static const std::string mode = "rb"; |
| 218 | std::unique_ptr<IOStream> fileStream(pIOHandler->Open(file, mode)); |
| 219 | if (!fileStream) { |
| 220 | throw DeadlyImportError("Failed to open file " + file + "."); |
| 221 | } |
| 222 | |
| 223 | XmlParser theParser; |
| 224 | if (!theParser.parse(fileStream.get())) { |
| 225 | return; |
| 226 | } |
| 227 | ParseFile(theParser); |
| 228 | } |
| 229 | |
| 230 | void X3DImporter::ParseFile(std::istream &myIstream) { |
| 231 | XmlParser theParser; |