Logo Search packages:      
Sourcecode: scummvm version File versions

bool File::open ( const FSNode node  )  [virtual]

Try to open the file corresponding to the give node. Will check whether the node actually refers to an existing file (and not a directory), and handle those cases gracefully.

Must not be called if this file already is open (i.e. if isOpen returns true).
filename the name of the file to open
archive the archive in which to search for the file
true if file was opened successfully, false otherwise

Definition at line 76 of file file.cpp.

References _handle, Common::String::c_str(), Common::FSNode::exists(), Common::FSNode::getPath(), Common::FSNode::isDirectory(), open(), and Common::FSNode::openForReading().


      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.openForReading();
      return open(stream, node.getPath());

Generated by  Doxygen 1.6.0   Back to index