Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Row.cs « metadata « Mono.PEToolkit « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4716cbfd080dd9306c06d771c64d848263936c01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
 * Copyright (c) 2002 Sergey Chaban <serge@wildwestsoftware.com>
 */

using System;
using System.IO;

namespace Mono.PEToolkit.Metadata {

	/// <summary>
	/// Metadata row interface.
	/// </summary>
	public interface Row {

		/// <summary>
		/// Number of colums in a row.
		/// </summary>
		int NumberOfColumns {get;}

		int Size {get;}

		/// <summary>
		/// Returns reference to parent table or null.
		/// </summary>
		MDTable Table {get;}

		void FromRawData(byte [] buff, int offs);

		void Dump(TextWriter writer);

	}


	public sealed class NullRow : Row {
		public static readonly NullRow Instance;

		static NullRow()
		{
			Instance = new NullRow();
		}

		private NullRow()
		{
		}

		public int NumberOfColumns {
			get {
				return 0;
			}
		}

		public int Size {
			get {
				return 0;
			}
		}

		public MDTable Table {
			get {
				return null;
			}
		}

		public void FromRawData(byte [] buff, int offs) 
		{
		}

		public void Dump(TextWriter writer)
		{
			writer.WriteLine("Null row.");
		}
	}

}