C# 클래스 Microsoft.Cci.CompositeSourceDocument

상속: SourceDocument, IDerivedSourceDocument
파일 보기 프로젝트 열기: visualmutator/visualmutator

Private Properties

프로퍼티 타입 설명
ObjectInvariant void
ToLineColumn void

공개 메소드들

메소드 설명
CopyTo ( int position, char destination, int destinationOffset, int length ) : int

Copies no more than the specified number of characters to the destination character array, starting at the specified position in the source document. Returns the actual number of characters that were copied. This number will be greater than zero as long as position is less than this.Length. The number will be precisely the number asked for unless there are not enough characters left in the document.

GetDerivedSourceLocation ( int position, int length ) : IDerivedSourceLocation

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.

GetFragmentLocationsFor ( ISourceLocation sourceLocation ) : IEnumerable

Returns an enumeration of fragments from other documents that together make up the given source location in this document.

GetPrimarySourceLocationsFor ( IDerivedSourceLocation derivedSourceLocation ) : IEnumerable

Returns zero or more primary source locations that correspond to the given derived location.

GetSourceLocation ( int position, int length ) : ISourceLocation

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.

GetText ( ) : string

Returns the source text of the document in string form. This call is expensive in time and space. Rather use CopyTo if at all possible.

ToLineColumn ( int position, int &line, int &column ) : void

Maps the given (zero based) source position to a (one based) line and column, by scanning the source character by character, counting new lines until the given source position is reached. The source position and corresponding line+column are remembered and scanning carries on where it left off when this routine is called next. If the given position precedes the last given position, scanning restarts from the start. Optimal use of this method requires the client to sort calls in order of position.

보호된 메소드들

메소드 설명
CompositeSourceDocument ( IName name ) : System

Allocates an object that represents a source document that is the composition of an ordered enumeration of fragments from other source document. The document is parsed according to the rules of a particular language, such as C#, to produce an object model that can be obtained via the CompilationPart property.

CompositeSourceDocument ( SourceDocument previousVersion, int position, int oldLength, int newLength ) : System

Allocates an object that represents a composite source document that is derived from another source document by replacing one substring with another.

GetFragments ( ) : IEnumerable

Returns an enumeration of fragments from other documents. The source of the enumeration could be a computation, such as a pre-processor.

비공개 메소드들

메소드 설명
ObjectInvariant ( ) : void
ToLineColumn ( int position, int &line, int &column, string text ) : void

Scans the given text string, incrementing line every time a new line sequence is encountered and incrementing column for every character scanned (resetting column to 1 every time line is incremented).

메소드 상세

CompositeSourceDocument() 보호된 메소드

Allocates an object that represents a source document that is the composition of an ordered enumeration of fragments from other source document. The document is parsed according to the rules of a particular language, such as C#, to produce an object model that can be obtained via the CompilationPart property.
protected CompositeSourceDocument ( IName name ) : System
name IName The name of the document. Used to identify the document in user interaction.
리턴 System

CompositeSourceDocument() 보호된 메소드

Allocates an object that represents a composite source document that is derived from another source document by replacing one substring with another.
protected CompositeSourceDocument ( SourceDocument previousVersion, int position, int oldLength, int newLength ) : System
previousVersion SourceDocument The source document on which the newly allocated document will be based.
position int The first character in the previous version of the new document that will be changed in the new document.
oldLength int The number of characters in the previous verion of the new document that will be changed in the new document.
newLength int The number of replacement characters in the new document. /// (The length of the string that replaces the substring from position to position+length in the previous version of the new document.)
리턴 System

CopyTo() 공개 메소드

Copies no more than the specified number of characters to the destination character array, starting at the specified position in the source document. Returns the actual number of characters that were copied. This number will be greater than zero as long as position is less than this.Length. The number will be precisely the number asked for unless there are not enough characters left in the document.
public CopyTo ( int position, char destination, int destinationOffset, int length ) : int
position int The starting index to copy from. Must be greater than or equal to zero and position+length must be less than or equal to this.Length;
destination char The destination array.
destinationOffset int The starting index where the characters must be copied to in the destination array.
length int The maximum number of characters to copy. Must be greater than 0 and less than or equal to the number elements of the destination array.
리턴 int

GetDerivedSourceLocation() 공개 메소드

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.
public GetDerivedSourceLocation ( int position, int length ) : IDerivedSourceLocation
position int
length int
리턴 IDerivedSourceLocation

GetFragmentLocationsFor() 공개 메소드

Returns an enumeration of fragments from other documents that together make up the given source location in this document.
public GetFragmentLocationsFor ( ISourceLocation sourceLocation ) : IEnumerable
sourceLocation ISourceLocation A location in this document.
리턴 IEnumerable

GetFragments() 보호된 메소드

Returns an enumeration of fragments from other documents. The source of the enumeration could be a computation, such as a pre-processor.
protected GetFragments ( ) : IEnumerable
리턴 IEnumerable

GetPrimarySourceLocationsFor() 공개 메소드

Returns zero or more primary source locations that correspond to the given derived location.
public GetPrimarySourceLocationsFor ( IDerivedSourceLocation derivedSourceLocation ) : IEnumerable
derivedSourceLocation IDerivedSourceLocation A source location in this derived document
리턴 IEnumerable

GetSourceLocation() 공개 메소드

Obtains a source location instance that corresponds to the substring of the document specified by the given start position and length.
public GetSourceLocation ( int position, int length ) : ISourceLocation
position int
length int
리턴 ISourceLocation

GetText() 공개 메소드

Returns the source text of the document in string form. This call is expensive in time and space. Rather use CopyTo if at all possible.
public GetText ( ) : string
리턴 string

ToLineColumn() 공개 메소드

Maps the given (zero based) source position to a (one based) line and column, by scanning the source character by character, counting new lines until the given source position is reached. The source position and corresponding line+column are remembered and scanning carries on where it left off when this routine is called next. If the given position precedes the last given position, scanning restarts from the start. Optimal use of this method requires the client to sort calls in order of position.
public ToLineColumn ( int position, int &line, int &column ) : void
position int
line int
column int
리턴 void