NTA_Int32 WriteBuffer::writeString(const NTA_Byte *value, NTA_Size size) { NTA_Int32 result = write("<s n=", 5); if(result != 0) return result; result = writeT(size, 0); if(result != 0) return result; result = writeT('>', 0); if(result != 0) return result; if(size) { result = write(value, size); if(result != 0) return result; } result = write("</s>", 4); return result; }
void ESMWriter::startRecord(const std::string& name, uint32_t flags) { mRecordCount++; writeName(name); RecordData rec; rec.name = name; rec.position = mStream->tellp(); rec.size = 0; writeT<uint32_t>(0); // Size goes here writeT<uint32_t>(0); // Unused header? writeT(flags); mRecords.push_back(rec); assert(mRecords.back().size == 0); }
Int32 WriteBuffer::write(const Real64 * value, Size size) { return writeT(value, size); }
Int32 WriteBuffer::write(Real64 value) { return writeT(value); }
Int32 WriteBuffer::write(UInt64 value) { return writeT(value); }
Int32 WriteBuffer::write(Int32 value) { return writeT(value); }
Int32 WriteBuffer::write(Byte value) { return writeT(value); }
void writeHNT(const std::string& name, const T& data, int size) { startSubRecord(name); writeT(data, size); endRecord(name); }