Logo Search packages:      
Sourcecode: scummvm version File versions

SeekableReadStream * Common::FSDirectory::openFile ( const String name  )  [virtual]

Open the specified file. A full match of relative path and filename is needed for success.

Implements Common::Archive.

Definition at line 139 of file archive.cpp.

References Common::String::c_str(), Common::String::empty(), Common::FSNode::exists(), Common::FSNode::isDirectory(), and Common::FSNode::openForReading().

                                                            {
      if (name.empty() || !_node.isDirectory())
            return 0;

      FSNode node = lookupCache(_fileCache, name);

      if (!node.exists()) {
            warning("FSDirectory::openFile: FSNode does not exist");
            return 0;
      } else if (node.isDirectory()) {
            warning("FSDirectory::openFile: FSNode is a directory");
            return 0;
      }

      SeekableReadStream *stream = node.openForReading();
      if (!stream)
            warning("FSDirectory::openFile: Can't create stream for file '%s'", name.c_str());

      return stream;
}


Generated by  Doxygen 1.6.0   Back to index