C# Class dnSpy.Contracts.Hex.HexBufferLineFormatter

Creates HexBufferLines
Show file Open project: 0xd4d/dnSpy Class Usage Examples

Public Methods

Method Description
EditValueCell ( dnSpy.Contracts.Hex.HexCell cell, int cellPosition, char c ) : PositionAndData?

Edits a value cell. Returns null if editing isn't supported or if the character isn't a valid input character (eg. it's not a hex digit character), else it returns the position in the buffer and new value.

FilterAndVerify ( HexBufferPoint position ) : HexBufferPoint

Filters the position so it's less than EndPosition if it equals EndPosition. It will throw if IsValidPosition(HexBufferPoint) returns false.

GetBufferPositionFromLineNumber ( HexPosition lineNumber ) : HexBufferPoint

Gets the buffer position of a line

GetCharsPerCell ( HexColumnType column ) : int

Gets the number of characters per cell value. This value doesn't include any cell separators

GetCharsPerCellIncludingSeparator ( HexColumnType column ) : int

Gets the total number of characters per cell. This includes cell separators if any.

GetColumnSpan ( HexColumnType column ) : Microsoft.VisualStudio.Text.Span

Gets the span of a column. This is empty if the column isn't present.

GetFormattedOffset ( HexPosition position ) : string

Returns the offset as a string

GetLineFromLineNumber ( HexPosition lineNumber ) : HexBufferLine

Returns a line

GetLineFromPosition ( HexBufferPoint position ) : HexBufferLine

Creates a line

GetLineNumberFromPosition ( HexBufferPoint position ) : HexPosition

Gets the line number

GetValueBufferSpan ( dnSpy.Contracts.Hex.HexCell cell, int cellPosition ) : HexBufferSpan

Gets a buffer span within a cell

IsValidPosition ( HexBufferPoint position ) : bool

Returns true if position is a valid position that can be passed to methods expecting a (physical) position.

ToLogicalPosition ( HexPosition physicalPosition ) : HexPosition

Converts a physical (stream) position to a logical position

ToPhysicalPosition ( HexPosition logicalPosition ) : HexPosition

Converts a logical position to a physical (stream) position

Protected Methods

Method Description
HexBufferLineFormatter ( ) : System

Constructor

Method Details

EditValueCell() public abstract method

Edits a value cell. Returns null if editing isn't supported or if the character isn't a valid input character (eg. it's not a hex digit character), else it returns the position in the buffer and new value.
public abstract EditValueCell ( dnSpy.Contracts.Hex.HexCell cell, int cellPosition, char c ) : PositionAndData?
cell dnSpy.Contracts.Hex.HexCell Cell
cellPosition int Position within the cell
c char Character
return PositionAndData?

FilterAndVerify() public method

Filters the position so it's less than EndPosition if it equals EndPosition. It will throw if IsValidPosition(HexBufferPoint) returns false.
public FilterAndVerify ( HexBufferPoint position ) : HexBufferPoint
position HexBufferPoint Position
return HexBufferPoint

GetBufferPositionFromLineNumber() public abstract method

Gets the buffer position of a line
public abstract GetBufferPositionFromLineNumber ( HexPosition lineNumber ) : HexBufferPoint
lineNumber HexPosition Line number
return HexBufferPoint

GetCharsPerCell() public abstract method

Gets the number of characters per cell value. This value doesn't include any cell separators
public abstract GetCharsPerCell ( HexColumnType column ) : int
column HexColumnType
return int

GetCharsPerCellIncludingSeparator() public abstract method

Gets the total number of characters per cell. This includes cell separators if any.
public abstract GetCharsPerCellIncludingSeparator ( HexColumnType column ) : int
column HexColumnType
return int

GetColumnSpan() public method

Gets the span of a column. This is empty if the column isn't present.
public GetColumnSpan ( HexColumnType column ) : Microsoft.VisualStudio.Text.Span
column HexColumnType Column
return Microsoft.VisualStudio.Text.Span

GetFormattedOffset() public abstract method

Returns the offset as a string
public abstract GetFormattedOffset ( HexPosition position ) : string
position HexPosition Position
return string

GetLineFromLineNumber() public abstract method

Returns a line
public abstract GetLineFromLineNumber ( HexPosition lineNumber ) : HexBufferLine
lineNumber HexPosition Line number
return HexBufferLine

GetLineFromPosition() public abstract method

Creates a line
public abstract GetLineFromPosition ( HexBufferPoint position ) : HexBufferLine
position HexBufferPoint Position
return HexBufferLine

GetLineNumberFromPosition() public abstract method

Gets the line number
public abstract GetLineNumberFromPosition ( HexBufferPoint position ) : HexPosition
position HexBufferPoint Position
return HexPosition

GetValueBufferSpan() public abstract method

Gets a buffer span within a cell
public abstract GetValueBufferSpan ( dnSpy.Contracts.Hex.HexCell cell, int cellPosition ) : HexBufferSpan
cell dnSpy.Contracts.Hex.HexCell Cell
cellPosition int Position within the cell
return HexBufferSpan

HexBufferLineFormatter() protected method

Constructor
protected HexBufferLineFormatter ( ) : System
return System

IsValidPosition() public method

Returns true if position is a valid position that can be passed to methods expecting a (physical) position.
public IsValidPosition ( HexBufferPoint position ) : bool
position HexBufferPoint Position
return bool

ToLogicalPosition() public abstract method

Converts a physical (stream) position to a logical position
public abstract ToLogicalPosition ( HexPosition physicalPosition ) : HexPosition
physicalPosition HexPosition Physical (stream) position
return HexPosition

ToPhysicalPosition() public abstract method

Converts a logical position to a physical (stream) position
public abstract ToPhysicalPosition ( HexPosition logicalPosition ) : HexPosition
logicalPosition HexPosition Logical position
return HexPosition