void ESMWriter::save(std::ostream& file) { m_recordCount = 0; m_stream = &file; startRecord("TES3", 0); m_header.records = 0; writeHNT("HEDR", m_header, 300); m_headerPos = m_stream->tellp() - (std::streampos)4; for (std::list<MasterData>::iterator it = m_masters.begin(); it != m_masters.end(); ++it) { writeHNCString("MAST", it->name); writeHNT("DATA", it->size); } endRecord("TES3"); }
void writeHNOCString(const std::string& name, const std::string& data) { if (!data.empty()) writeHNCString(name, data); }