C# Class WebMarkupMin.Core.Utilities.SourceCodeNavigator

Show file Open project: Taritsyn/WebMarkupMin

Public Methods

Method Description
CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, SourceCodeNodeCoordinates relativeNodeCoordinates ) : SourceCodeNodeCoordinates

Calculates a absolute node coordinates

CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, int lineBreakCount, int charRemainderCount ) : SourceCodeNodeCoordinates

Calculates a absolute node coordinates

CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, string additionalContent ) : SourceCodeNodeCoordinates

Calculates a absolute node coordinates

CalculateLineBreakCount ( string sourceCode, int &lineBreakCount, int &charRemainderCount ) : void

Calculates a line break count

CalculateLineBreakCount ( string sourceCode, int fragmentStartPosition, int &lineBreakCount, int &charRemainderCount ) : void

Calculates a line break count

CalculateLineBreakCount ( string sourceCode, int fragmentStartPosition, int fragmentLength, int &lineBreakCount, int &charRemainderCount ) : void

Calculates a line break count

CalculateNodeCoordinates ( string sourceCode, int nodePosition ) : SourceCodeNodeCoordinates

Calculates a node coordinates

GetCurrentLine ( string sourceCode, int currentPosition, int &startLinePosition, int &endLinePosition ) : string

Gets a current line content

GetSourceFragment ( string sourceCode, SourceCodeNodeCoordinates nodeCoordinates, byte tabSize = DEFAULT_TAB_SIZE, int maxFragmentLength = DEFAULT_MAX_FRAGMENT_LENGTH ) : string

Gets a source fragment

GetSourceFragment ( string sourceCode, int nodePosition, byte tabSize = DEFAULT_TAB_SIZE, int maxFragmentLength = DEFAULT_MAX_FRAGMENT_LENGTH ) : string

Gets a source fragment

Private Methods

Method Description
CalculateCutPositions ( string line, int columnNumber, int maxFragmentLength, int &fragmentStartPosition, int &fragmentLength ) : void

Calculates a cut positions

FindNextLineBreak ( string sourceCode, int startPosition, int &lineBreakPosition, int &lineBreakLength ) : void

Finds a next line break

FindNextLineBreak ( string sourceCode, int startPosition, int length, int &lineBreakPosition, int &lineBreakLength ) : void

Finds a next line break

FindPreviousLineBreak ( string sourceCode, int startPosition, int &lineBreakPosition, int &lineBreakLength ) : void

Finds a previous line break

FormatSourceCodeLine ( string line, SourceCodeNodeCoordinates nodeCoordinates, int lineNumberSize, int fragmentStartPosition, int fragmentLength, byte tabSize = 4 ) : string

Formats a line of source code

Method Details

CalculateAbsoluteNodeCoordinates() public static method

Calculates a absolute node coordinates
public static CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, SourceCodeNodeCoordinates relativeNodeCoordinates ) : SourceCodeNodeCoordinates
baseNodeCoordinates SourceCodeNodeCoordinates Base node coordinates
relativeNodeCoordinates SourceCodeNodeCoordinates Relative node coordinates
return SourceCodeNodeCoordinates

CalculateAbsoluteNodeCoordinates() public static method

Calculates a absolute node coordinates
public static CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, int lineBreakCount, int charRemainderCount ) : SourceCodeNodeCoordinates
baseNodeCoordinates SourceCodeNodeCoordinates Base node coordinates
lineBreakCount int Number of line breaks
charRemainderCount int Number of characters left
return SourceCodeNodeCoordinates

CalculateAbsoluteNodeCoordinates() public static method

Calculates a absolute node coordinates
public static CalculateAbsoluteNodeCoordinates ( SourceCodeNodeCoordinates baseNodeCoordinates, string additionalContent ) : SourceCodeNodeCoordinates
baseNodeCoordinates SourceCodeNodeCoordinates Base node coordinates
additionalContent string Additional content
return SourceCodeNodeCoordinates

CalculateLineBreakCount() public static method

Calculates a line break count
public static CalculateLineBreakCount ( string sourceCode, int &lineBreakCount, int &charRemainderCount ) : void
sourceCode string Source code
lineBreakCount int Number of line breaks
charRemainderCount int Number of characters left
return void

CalculateLineBreakCount() public static method

Calculates a line break count
public static CalculateLineBreakCount ( string sourceCode, int fragmentStartPosition, int &lineBreakCount, int &charRemainderCount ) : void
sourceCode string Source code
fragmentStartPosition int Start position of fragment
lineBreakCount int Number of line breaks
charRemainderCount int Number of characters left
return void

CalculateLineBreakCount() public static method

Calculates a line break count
public static CalculateLineBreakCount ( string sourceCode, int fragmentStartPosition, int fragmentLength, int &lineBreakCount, int &charRemainderCount ) : void
sourceCode string Source code
fragmentStartPosition int Start position of fragment
fragmentLength int Length of fragment
lineBreakCount int Number of line breaks
charRemainderCount int Number of characters left
return void

CalculateNodeCoordinates() public static method

Calculates a node coordinates
public static CalculateNodeCoordinates ( string sourceCode, int nodePosition ) : SourceCodeNodeCoordinates
sourceCode string Source code
nodePosition int Current node position
return SourceCodeNodeCoordinates

GetCurrentLine() public static method

Gets a current line content
public static GetCurrentLine ( string sourceCode, int currentPosition, int &startLinePosition, int &endLinePosition ) : string
sourceCode string Source code
currentPosition int Current position
startLinePosition int Start position of line
endLinePosition int End position of line
return string

GetSourceFragment() public static method

Gets a source fragment
public static GetSourceFragment ( string sourceCode, SourceCodeNodeCoordinates nodeCoordinates, byte tabSize = DEFAULT_TAB_SIZE, int maxFragmentLength = DEFAULT_MAX_FRAGMENT_LENGTH ) : string
sourceCode string Source code
nodeCoordinates SourceCodeNodeCoordinates Node coordinates
tabSize byte Number of spaces in the tab
maxFragmentLength int Maximum length of the source fragment
return string

GetSourceFragment() public static method

Gets a source fragment
public static GetSourceFragment ( string sourceCode, int nodePosition, byte tabSize = DEFAULT_TAB_SIZE, int maxFragmentLength = DEFAULT_MAX_FRAGMENT_LENGTH ) : string
sourceCode string Source code
nodePosition int Current node position
tabSize byte Number of spaces in the tab
maxFragmentLength int Maximum length of the source fragment
return string