Logo Search packages:      
Sourcecode: scummvm version File versions

Common::SeekableReadStream * Common::FSNode::openForReading (  )  const [virtual]

Creates a SeekableReadStream instance corresponding to the file referred by this node. This assumes that the node actually refers to a readable file. If this is not the case, 0 is returned.

Returns:
pointer to the stream object, 0 in case of a failure

Definition at line 138 of file fs.cpp.

Referenced by Common::File::open(), OSystem::openConfigFileForReading(), Common::FSDirectory::openFile(), DefaultSaveFileManager::openForLoading(), and Agi::WagFileParser::parse().

                                                       {
      if (_realNode == 0)
            return 0;

      if (!_realNode->exists()) {
            warning("FSNode::openForReading: FSNode does not exist");
            return false;
      } else if (_realNode->isDirectory()) {
            warning("FSNode::openForReading: FSNode is a directory");
            return false;
      }

      return _realNode->openForReading();
}


Generated by  Doxygen 1.6.0   Back to index