bool XMLParser::loadFile(const FSNode &node) { _stream = node.createReadStream(); if (!_stream) return false; _fileName = node.getName(); return true; }
SeekableReadStream *FSDirectory::createReadStreamForMember(const String &name) const { if (name.empty() || !_node.isDirectory()) return 0; FSNode *node = lookupCache(_fileCache, name); if (!node) return 0; SeekableReadStream *stream = node->createReadStream(); if (!stream) warning("FSDirectory::createReadStreamForMember: Can't create stream for file '%s'", name.c_str()); return stream; }
bool File::open(const FSNode &node) { assert(!_handle); if (!node.exists()) { warning("File::open: '%s' does not exist", node.getPath().c_str()); return false; } else if (node.isDirectory()) { warning("File::open: '%s' is a directory", node.getPath().c_str()); return false; } SeekableReadStream *stream = node.createReadStream(); return open(stream, node.getPath()); }