Ejemplo n.º 1
0
 private void WriteRecord()
 {
     if (this.m_currentRecord.Count >= 1)
     {
         this.RawWriteByte(0x4d);
         this.RawWriteInt16(this.m_currentRecord.Count);
         int num2 = this.m_currentRecord.Count - 1;
         for (int i = 0; i <= num2; i++)
         {
             SimpleDB.Entry     entry = this.m_currentRecord[i];
             SimpleDB.EntryType type  = entry.Type;
             if (type == SimpleDB.EntryType.Boolean)
             {
                 this.RawWriteByte(0x42);
                 this.RawWriteByte(Conversions.ToByte(Conversions.ToBoolean(entry.Value) ? 1 : 0));
             }
             else if (type == SimpleDB.EntryType.Byte)
             {
                 this.RawWriteByte(0x62);
                 this.RawWriteByte(Conversions.ToByte(entry.Value));
             }
             else if (type == SimpleDB.EntryType.String)
             {
                 this.RawWriteByte(0x53);
                 SimpleDB.Entry entry2 = entry;
                 string         text   = Conversions.ToString(entry2.Value);
                 this.RawWriteCString(text);
                 entry2.Value = text;
             }
             else if (type == SimpleDB.EntryType.UInt16)
             {
                 this.RawWriteByte(0x49);
                 this.RawWriteInt16(Conversions.ToInteger(entry.Value));
             }
             else
             {
                 this.RawWriteByte(0x45);
             }
         }
         this.m_currentRecord.Clear();
     }
 }
Ejemplo n.º 2
0
 public IOException(SimpleDB.EntryType Type, BinaryReader Reader) : base("Type mismatch in file. Read '" + Conversions.ToString(Strings.ChrW((int)Type)) + "' at " + Conversions.ToString(Reader.BaseStream.Position))
 {
 }
Ejemplo n.º 3
0
 public Entry(SimpleDB.EntryType Type, object Value)
 {
     this.Type  = Type;
     this.Value = RuntimeHelpers.GetObjectValue(Value);
 }
Ejemplo n.º 4
0
 // Methods
 public Entry()
 {
     this.Type  = SimpleDB.EntryType.Empty;
     this.Value = "";
 }