1 // ==++==
2 //
3 //   Copyright (c) Microsoft Corporation.  All rights reserved.
4 //
5 // ==--==
6 /*============================================================
7 **
8 ** Class:  ISymbolReader
9 **
10 **
11 ** Represents a symbol reader for managed code. Provides access to
12 ** documents, methods, and variables.
13 **
14 **
15 ===========================================================*/
16 namespace System.Diagnostics.SymbolStore {
17     // Interface does not need to be marked with the serializable attribute
18     using System;
19     using System.Runtime.InteropServices;
20 
21 
22 [System.Runtime.InteropServices.ComVisible(true)]
23     public interface ISymbolReader
24     {
25         // Find a document. Language, vendor, and document type are
26         // optional.
GetDocument(String url, Guid language, Guid languageVendor, Guid documentType)27         ISymbolDocument GetDocument(String url,
28                                         Guid language,
29                                         Guid languageVendor,
30                                         Guid documentType);
31 
32         // Return an array of all of the documents defined in the symbol
33         // store.
GetDocuments()34         ISymbolDocument[] GetDocuments();
35 
36         // Return the method that was specified as the user entry point
37         // for the module, if any. This would be, perhaps, the user's main
38         // method rather than compiler generated stubs before main.
39         SymbolToken UserEntryPoint { get; }
40 
41         // Get a symbol reader method given the id of a method.
GetMethod(SymbolToken method)42         ISymbolMethod GetMethod(SymbolToken method);
43 
44         // Get a symbol reader method given the id of a method and an E&C
45         // version number. Version numbers start a 1 and are incremented
46         // each time the method is changed due to an E&C operation.
GetMethod(SymbolToken method, int version)47         ISymbolMethod GetMethod(SymbolToken method, int version);
48 
49         // Return a non-local variable given its parent and name.
GetVariables(SymbolToken parent)50         ISymbolVariable[] GetVariables(SymbolToken parent);
51 
52         // Return a non-local variable given its parent and name.
GetGlobalVariables()53         ISymbolVariable[] GetGlobalVariables();
54 
55         // Given a position in a document, return the ISymbolMethod that
56         // contains that position.
GetMethodFromDocumentPosition(ISymbolDocument document, int line, int column)57         ISymbolMethod GetMethodFromDocumentPosition(ISymbolDocument document,
58                                                         int line,
59                                                         int column);
60 
61         // Gets a custom attribute based upon its name. Not to be
62         // confused with Metadata custom attributes, these attributes are
63         // held in the symbol store.
GetSymAttribute(SymbolToken parent, String name)64         byte[] GetSymAttribute(SymbolToken parent, String name);
65 
66         // Get the namespaces defined at global scope within this symbol store.
GetNamespaces()67         ISymbolNamespace[] GetNamespaces();
68     }
69 
70 }
71