/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected override void WriteHeader(ResWriter writer) { headerStartPosition = writer.Position; base.WriteHeader(writer); writer.WriteInt32(id); writer.WriteFixedLenghtUnicodeString(name, 128); typeStringsMark = writer.MarkInt32(); writer.WriteInt32(typeStrings.Count); keyStringsMark = writer.MarkInt32(); writer.WriteInt32(KeyStrings.Count); }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected override void WriteHeader(ResWriter writer) { base.WriteHeader(writer); // header writer.WriteInt32(Count); // stringCount writer.WriteInt32(0); // styleCount var flags = (StringPoolFlags)0; if (IsUtf8) { flags |= StringPoolFlags.UTF8_FLAG; } writer.WriteInt32((int)flags); // flags writer.WriteInt32(28 + Count * 4); // stringsStart writer.WriteInt32(0); // stylesStart }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected sealed override void WriteHeader(ResWriter writer) { base.WriteHeader(writer); writer.WriteInt32(LineNumber); StringPoolRef.Write(writer, tree.StringPool, Comment); // Extended data (in derived types) is not part of the header }
/// <summary> /// Write this chunk. /// </summary> public void Write(ResWriter writer) { // Prepare PrepareForWrite(); // First pass var position = writer.Stream.Position; WriteHeader(writer); headerSize = (int)(writer.Stream.Position - position); WriteData(writer); var endPosition = writer.Stream.Position; size = (int)(endPosition - position); if ((size & 0x03) != 0) { } // Update header writer.Stream.Position = position + 2; writer.WriteUInt16(headerSize); writer.WriteInt32(size); writer.Stream.Position = endPosition; }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected override void WriteHeader(ResWriter writer) { base.WriteHeader(writer); writer.WriteByte(id); writer.WriteByte(0); // res0 writer.WriteUInt16(0); // res1 writer.WriteInt32(entries.Count); // entryCount }
/// <summary> /// Write this chunk. /// </summary> public void Write(ResWriter writer) { var size = 8; writer.WriteUInt16(size); writer.Fill(1); // res0 writer.WriteByte((int)type); writer.WriteInt32(data); }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected override void WriteHeader(ResWriter writer) { var startPosition = writer.Position; base.WriteHeader(writer); writer.WriteByte(parent.Id); writer.WriteByte(0); // res0 writer.WriteUInt16(0); // res1 writer.WriteInt32(parent.EntryCount); // entryCount var entriesStartMark = writer.MarkInt32(); // entriesStart configuration.Write(writer); // Patch entriesStart entriesStartMark.Value = (writer.Position - startPosition) + (parent.EntryCount * 4); }
/// <summary> /// Save to given writer /// </summary> internal void Write(ResWriter writer) { writer.WriteInt32(data.Length + 4); writer.WriteByteArray(data); }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected override void WriteHeader(ResWriter writer) { base.WriteHeader(writer); writer.WriteInt32(packages.Count); // packageCount }
/// <summary> /// Write the header of this chunk. /// Always call the base method first. /// </summary> protected virtual void WriteHeader(ResWriter writer) { writer.WriteUInt16((int)type); writer.WriteUInt16(0); // Header size will be updated later writer.WriteInt32(0); // Size will be updated later }