public string Dump() { reader.Reset(); if (serializedType?.m_Nodes != null) { var sb = new StringBuilder(); TypeTreeHelper.ReadTypeString(sb, serializedType.m_Nodes, reader); return(sb.ToString()); } return(null); }
protected Object(ObjectReader reader) { this.reader = reader; reader.Reset(); sourceFile = reader.assetsFile; version = reader.version; buildType = reader.buildType; platform = reader.platform; if (platform == BuildTarget.NoTarget) { var m_ObjectHideFlags = reader.ReadUInt32(); } }
public static void ReadTypeString(StringBuilder sb, List <TypeTreeNode> members, ObjectReader reader) { reader.Reset(); for (int i = 0; i < members.Count; i++) { ReadStringValue(sb, members, reader, ref i); } var readed = reader.Position - reader.byteStart; if (readed != reader.byteSize) { Logger.Error($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes"); } }
public Object(ObjectReader reader) { this.reader = reader; reader.Reset(); assetsFile = reader.assetsFile; type = reader.type; m_PathID = reader.m_PathID; version = reader.version; buildType = reader.buildType; platform = reader.platform; serializedType = reader.serializedType; byteSize = reader.byteSize; if (platform == BuildTarget.NoTarget) { var m_ObjectHideFlags = reader.ReadUInt32(); } }
public static string ReadTypeString(TypeTree m_Type, ObjectReader reader) { reader.Reset(); var sb = new StringBuilder(); var m_Nodes = m_Type.m_Nodes; for (int i = 0; i < m_Nodes.Count; i++) { ReadStringValue(sb, m_Nodes, reader, ref i); } var readed = reader.Position - reader.byteStart; if (readed != reader.byteSize) { Logger.Info($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes"); } return(sb.ToString()); }
public static OrderedDictionary ReadType(List <TypeTreeNode> members, ObjectReader reader) { reader.Reset(); var obj = new OrderedDictionary(); for (int i = 1; i < members.Count; i++) { var member = members[i]; var varNameStr = member.m_Name; obj[varNameStr] = ReadValue(members, reader, ref i); } var readed = reader.Position - reader.byteStart; if (readed != reader.byteSize) { Logger.Error($"Error while read type, read {readed} bytes but expected {reader.byteSize} bytes"); } return(obj); }
public byte[] GetRawData() { reader.Reset(); return(reader.ReadBytes((int)byteSize)); }