public Section(string file, BinaryReader reader, BiniStringBlock stringBlock) { if (reader == null) { throw new ArgumentNullException("reader"); } if (stringBlock == null) { throw new ArgumentNullException("stringBlock"); } File = file; short nameOffset = reader.ReadInt16(); Name = stringBlock.Get(nameOffset); short count = reader.ReadInt16(); entries = new List <Entry>(count); for (int i = 0; i < count; i++) { entries.Add(new Entry(file, reader, stringBlock)); } }
public StringValue(BinaryReader reader, BiniStringBlock stringBlock) { if (reader == null) { throw new ArgumentNullException("reader"); } if (stringBlock == null) { throw new ArgumentNullException("stringBlock"); } this.valuePointer = reader.ReadInt32(); this.value = stringBlock.Get(valuePointer); }
public Entry(string file, BinaryReader reader, BiniStringBlock stringBlock) { if (reader == null) { throw new ArgumentNullException("reader"); } if (stringBlock == null) { throw new ArgumentNullException("stringBlock"); } File = file; short nameOffset = reader.ReadInt16(); Name = stringBlock.Get(nameOffset); byte count = reader.ReadByte(); values = new List <IValue>(count); for (int i = 0; i < count; i++) { IniValueType valueType = (IniValueType)reader.ReadByte(); switch (valueType) { case IniValueType.Boolean: values.Add(new BooleanValue(reader)); break; case IniValueType.Int32: values.Add(new Int32Value(reader)); break; case IniValueType.Single: values.Add(new SingleValue(reader)); break; case IniValueType.String: values.Add(new StringValue(reader, stringBlock)); break; default: throw new FileContentException(BINI, "Unknown BINI value type: " + valueType); } } }