bool dump2DA(const Common::UString &name) { Common::SeekableReadStream *twoDAFile = 0; bool success = false; try { if (!(twoDAFile = ResMan.getResource(name, Aurora::kFileType2DA))) return false; Aurora::TwoDAFile twoda; twoda.load(*twoDAFile); success = twoda.dumpASCII(name + ".2da"); } catch (...) { } delete twoDAFile; return success; }
void dump2DA(Aurora::TwoDAFile &twoDA, const Common::UString &outFile, Format format) { Common::WriteStream *out = 0; if (!outFile.empty()) out = new Common::WriteFile(outFile); else out = new Common::StdOutStream; try { if (format == kFormat2DA) twoDA.dumpASCII(*out); else twoDA.dumpCSV(*out); } catch (...) { delete out; throw; } out->flush(); delete out; }