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

Document.cs « Mono.Cecil.Cil - github.com/mono/cecil.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 03d3ec301d2ba357802e75b9c2b56df2971df06f (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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//
// Author:
//   Jb Evain (jbevain@gmail.com)
//
// Copyright (c) 2008 - 2015 Jb Evain
// Copyright (c) 2008 - 2011 Novell, Inc.
//
// Licensed under the MIT/X11 license.
//

using System;

namespace Mono.Cecil.Cil {

	public enum DocumentType {
		Other,
		Text,
	}

	public enum DocumentHashAlgorithm {
		None,
		MD5,
		SHA1,
		SHA256,
	}

	public enum DocumentLanguage {
		Other,
		C,
		Cpp,
		CSharp,
		Basic,
		Java,
		Cobol,
		Pascal,
		Cil,
		JScript,
		Smc,
		MCpp,
		FSharp,
	}

	public enum DocumentLanguageVendor {
		Other,
		Microsoft,
	}

	public sealed class Document : DebugInformation {

		string url;

		Guid type;
		Guid hash_algorithm;
		Guid language;
		Guid language_vendor;

		byte [] hash;
		byte [] embedded_source;

		public string Url {
			get { return url; }
			set { url = value; }
		}

		public DocumentType Type {
			get { return type.ToType (); }
			set { type = value.ToGuid (); }
		}

		public Guid TypeGuid {
			get { return type; }
			set { type = value; }
		}

		public DocumentHashAlgorithm HashAlgorithm {
			get { return hash_algorithm.ToHashAlgorithm (); }
			set { hash_algorithm = value.ToGuid (); }
		}

		public Guid HashAlgorithmGuid {
			get { return hash_algorithm; }
			set { hash_algorithm = value; }
		}

		public DocumentLanguage Language {
			get { return language.ToLanguage (); }
			set { language = value.ToGuid (); }
		}

		public Guid LanguageGuid {
			get { return language; }
			set { language = value; }
		}

		public DocumentLanguageVendor LanguageVendor {
			get { return language_vendor.ToVendor (); }
			set { language_vendor = value.ToGuid (); }
		}

		public Guid LanguageVendorGuid {
			get { return language_vendor; }
			set { language_vendor = value; }
		}

		public byte [] Hash {
			get { return hash; }
			set { hash = value; }
		}

		public byte[] EmbeddedSource {
			get { return embedded_source; }
			set { embedded_source = value; }
		}

		public Document (string url)
		{
			this.url = url;
			this.hash = Empty<byte>.Array;
			this.embedded_source = Empty<byte>.Array;
			this.token = new MetadataToken (TokenType.Document);
		}
	}
}