Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

Common::InSaveFile * DefaultSaveFileManager::openForLoading ( const Common::String name  )  [virtual, inherited]

Open the file with the specified name in the given directory for loading.

name the name of the savefile
pointer to an InSaveFile, or NULL if an error occurred.

Implements Common::SaveFileManager.

Definition at line 80 of file default-saves.cpp.

References DefaultSaveFileManager::checkPath(), Common::FSNode::createReadStream(), Common::FSNode::exists(), Common::FSNode::getChild(), Common::SaveFileManager::getError(), and DefaultSaveFileManager::getSavePath().

      // Ensure that the savepath is valid. If not, generate an appropriate error.
      Common::String savePathName = getSavePath();
      if (getError() != Common::kNoError)
            return 0;

      // recreate FSNode since checkPath may have changed/created the directory
      Common::FSNode savePath(savePathName);

      Common::FSNode file = savePath.getChild(filename);
      if (!file.exists())
            return 0;

      // Open the file for reading
      Common::SeekableReadStream *sf = file.createReadStream();

      return Common::wrapCompressedReadStream(sf);

Generated by  Doxygen 1.6.0   Back to index