Exemplo n.º 1
0
		public static IndexEntry GetNextEntry (BinaryReader br)
		{
			IndexEntry entry = new IndexEntry ();
			
			// Content
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			
			// SHA1 5x32 = 160
			//??? Console.WriteLine (Mono.Git.Core.Object.BytesToHexString (br.ReadBytes (20)));
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			Console.WriteLine (br.ReadInt32 ());
			
			//entry = br.ReadInt16 (); // flag
			Console.Write ("Characters: ");
			
			for (;;) {
				char c = br.ReadChar ();
				if (c == '\0')
					break;
				Console.Write (c);
			}
			
			Console.Write ('\n');
			
			return entry;
		}
Exemplo n.º 2
0
		public void AddEntry (IndexEntry indexEntry)
		{
			ArrayList array = new ArrayList (entries);
			
			array.Add (indexEntry);
			
			entries = (IndexEntry[]) array.ToArray ();
		}
Exemplo n.º 3
0
		public void RemoveEntry (IndexEntry indexEntry)
		{
			ArrayList array = new ArrayList (entries);
			
			array.Remove (indexEntry);
			
			entries = (IndexEntry[]) array.ToArray ();
		}
Exemplo n.º 4
0
		public IndexHeader (IndexEntry[] indexEntries)
		{
			signature = 0x44495243;
			version = 2;
			entries = indexEntries.Length;
		}