uint32 TalkTable_TLK::getLanguageID(const Common::UString &file) { Common::ReadFile tlk; if (!tlk.open(file)) return kLanguageInvalid; return getLanguageID(tlk); }
bool GameInstanceEngine::probe() { if (Common::FilePath::isDirectory(_target)) { // Try to probe from that directory Common::FileList rootFiles; if (!rootFiles.addDirectory(_target)) // Fatal: can't read the directory return false; return probe(rootFiles); } if (Common::FilePath::isRegularFile(_target)) { // Try to probe from that file Common::ReadFile file; if (file.open(_target)) return probe(file); } return false; }
bool Campaign::readCampaign(const Common::UString &mmdFile, CampaignDescription &desc) { Common::ReadFile *file = new Common::ReadFile; if (!file->open(mmdFile)) { delete file; return false; } Aurora::GFF3File *gff = 0; try { gff = new Aurora::GFF3File(file, MKTAG('M', 'M', 'D', ' ')); } catch (...) { return false; } gff->getTopLevel().getLocString("Meta_Name", desc.name); gff->getTopLevel().getLocString("Meta_Desc", desc.description); delete gff; desc.file = mmdFile; desc.tag = Common::FilePath::getStem(mmdFile).toLower(); return true; }