Logo Search packages:      
Sourcecode: scummvm version File versions

bool File::open ( const String filename,
Archive archive 
) [virtual]

Try to open the file with the given filename from within the given archive.

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 56 of file file.cpp.

References _handle, Common::String::c_str(), clearIOFailed(), Common::String::empty(), Common::Archive::hasFile(), open(), and Common::Archive::openFile().



      SeekableReadStream *stream = 0;
      if (archive.hasFile(filename)) {
            debug(3, "Opening hashed: %s", filename.c_str());
            stream = archive.openFile(filename);
      } else if (archive.hasFile(filename + ".")) {
            // WORKAROUND: Bug #1458388: "SIMON1: Game Detection fails"
            // sometimes instead of "GAMEPC" we get "GAMEPC." (note trailing dot)
            debug(3, "Opening hashed: %s.", filename.c_str());
            stream = archive.openFile(filename + ".");

      return open(stream, filename);

Generated by  Doxygen 1.6.0   Back to index