public override void CacheData(CompilerTag tag) { Tagnames.Add(tag.Filename); }
public override void CacheData(CompilerTag tag) { tag.ID = Entries.Count; Entries.Add(new Entry() { Type = tag.Type, Index = new TagIndex(Entries.Count), Length = (int)tag.TagStream.Length }); }
public void CacheData(CompilerTag tag, StringsCache cache) { int index = Values.Count; CacheData(tag); int count = Values.Count; for (int i = index; i < count; i++) { string str = tag.Strings[Values[i].StringId]; Values[i].StringId = new StringId((short)cache.Values.IndexOf(str), (sbyte)Encoding.UTF8.GetByteCount(str)); } }
public override void CacheData(CompilerTag tag) { BinaryReader binReader = new BinaryReader(tag.TagStream); BinaryWriter binWriter = new BinaryWriter(tag.TagStream); tag.TagStream.Position = 0; int count = binReader.ReadInt32(); int address = binReader.ReadInt32(); int strLength = binReader.ReadInt32(); int strAddress = binReader.ReadInt32(); tag.TagStream.Position = strAddress; byte[] unicodeBytes = binReader.ReadBytes(strLength); int index = Values.Count; for (int i = 0; i < count; i++) { tag.TagStream.Position = address + (i * 40); int stringid = binReader.ReadInt32(); int offset = binReader.ReadInt32(); List<byte> strBytes = new List<byte>(); byte c; while (true) { c = unicodeBytes[offset]; if (c == byte.MinValue) break; strBytes.Add(c); offset++; } Values.Add(new Entry() { StringId = stringid, UnicodeString = Encoding.UTF8.GetString(strBytes.ToArray()) }); } tag.TagStream.SetLength(52); tag.TagStream.Position = 0; binWriter.Write(new byte[16]); binWriter.Write((short)index); binWriter.Write((short)count); binWriter.Write(new byte[32]); tag.Type = "unic"; }
public abstract void CacheData(CompilerTag tag);
public override void CacheData(CompilerTag tag) { foreach (string value in tag.Strings) { if (!Values.Contains(value)) { Values.Add(value); } } }
public override void CacheData(CompilerTag tag) { if (tag.ResourceStream.Length == 0) return; Entry entry = new Entry() { Offset = (int)Stream.Position, Length = (int)tag.ResourceStream.Length }; for (int i = 0; i < tag.RawOffsets.Length; i++) tag.RawOffsets[i] += entry.Offset; Tags.Add(entry); TagIDs.Add(tag.ID); BinaryWriter bw = new BinaryWriter(Stream); bw.Write(tag.ResourceStream.ToArray()); bw.Flush(); }
public override void CacheData(CompilerTag tag) { BinaryWriter bw = new BinaryWriter(Stream); bw.Write(Padding.GetBytes(Stream.Position)); Entry entry = new Entry() { Offset = (int)Stream.Position, Length = (int)tag.TagStream.Length, PointerOffsets = tag.PointerOffsets, RawOffsets = tag.RawOffsets, StringIDOffsets = tag.StringIdOffsets, TagIDOffsets = tag.TagReferenceOffsets }; tag.TagStream.WriteTo(Stream); bw.Flush(); Entries.Add(entry); TagIndexers.Add(tag.ID); }
public override void CacheData(CompilerTag tag) { Tags.Add(tag); }