Exemplo n.º 1
0
bool XMLParser::loadFile(const FSNode &node) {
	_stream = node.createReadStream();
	if (!_stream)
		return false;

	_fileName = node.getName();
	return true;
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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());
}