2014-08-13 10:39:27 +01:00
|
|
|
//
|
|
|
|
// Author:
|
|
|
|
// Jb Evain (jbevain@gmail.com)
|
|
|
|
//
|
2016-11-10 13:04:39 +00:00
|
|
|
// Copyright (c) 2008 - 2015 Jb Evain
|
|
|
|
// Copyright (c) 2008 - 2011 Novell, Inc.
|
2014-08-13 10:39:27 +01:00
|
|
|
//
|
2016-11-10 13:04:39 +00:00
|
|
|
// Licensed under the MIT/X11 license.
|
2014-08-13 10:39:27 +01:00
|
|
|
//
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Mono.Cecil.Cil {
|
|
|
|
|
|
|
|
public enum DocumentType {
|
|
|
|
Other,
|
|
|
|
Text,
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum DocumentHashAlgorithm {
|
|
|
|
None,
|
|
|
|
MD5,
|
|
|
|
SHA1,
|
2016-11-10 13:04:39 +00:00
|
|
|
SHA256,
|
2014-08-13 10:39:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public enum DocumentLanguage {
|
|
|
|
Other,
|
|
|
|
C,
|
|
|
|
Cpp,
|
|
|
|
CSharp,
|
|
|
|
Basic,
|
|
|
|
Java,
|
|
|
|
Cobol,
|
|
|
|
Pascal,
|
|
|
|
Cil,
|
|
|
|
JScript,
|
|
|
|
Smc,
|
|
|
|
MCpp,
|
|
|
|
FSharp,
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum DocumentLanguageVendor {
|
|
|
|
Other,
|
|
|
|
Microsoft,
|
|
|
|
}
|
|
|
|
|
2016-11-10 13:04:39 +00:00
|
|
|
public sealed class Document : DebugInformation {
|
2014-08-13 10:39:27 +01:00
|
|
|
|
|
|
|
string url;
|
|
|
|
|
|
|
|
byte type;
|
|
|
|
byte hash_algorithm;
|
|
|
|
byte language;
|
|
|
|
byte language_vendor;
|
|
|
|
|
|
|
|
byte [] hash;
|
|
|
|
|
|
|
|
public string Url {
|
|
|
|
get { return url; }
|
|
|
|
set { url = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public DocumentType Type {
|
|
|
|
get { return (DocumentType) type; }
|
|
|
|
set { type = (byte) value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public DocumentHashAlgorithm HashAlgorithm {
|
|
|
|
get { return (DocumentHashAlgorithm) hash_algorithm; }
|
|
|
|
set { hash_algorithm = (byte) value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public DocumentLanguage Language {
|
|
|
|
get { return (DocumentLanguage) language; }
|
|
|
|
set { language = (byte) value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public DocumentLanguageVendor LanguageVendor {
|
|
|
|
get { return (DocumentLanguageVendor) language_vendor; }
|
|
|
|
set { language_vendor = (byte) value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public byte [] Hash {
|
|
|
|
get { return hash; }
|
|
|
|
set { hash = value; }
|
|
|
|
}
|
|
|
|
|
|
|
|
public Document (string url)
|
|
|
|
{
|
|
|
|
this.url = url;
|
|
|
|
this.hash = Empty<byte>.Array;
|
2016-11-10 13:04:39 +00:00
|
|
|
this.token = new MetadataToken (TokenType.Document);
|
2014-08-13 10:39:27 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|