C# 클래스 dnSpy.Contracts.Hex.HexBuffer

Hex buffer
상속: Microsoft.VisualStudio.Utilities.IPropertyOwner, IDisposable
파일 보기 프로젝트 열기: 0xd4d/dnSpy 1 사용 예제들

공개 메소드들

메소드 설명
CheckEditAccess ( ) : bool

Returns true if the current thread is allowed to modify the buffer

CreateEdit ( ) : dnSpy.Contracts.Hex.HexEdit

Creates a HexEdit object

CreateEdit ( int reiteratedVersionNumber, object editTag ) : dnSpy.Contracts.Hex.HexEdit

Creates a HexEdit object

Dispose ( ) : void

Disposes this instance

GetNextValidSpan ( HexPosition position, HexPosition upperBounds, bool fullSpan ) : HexSpan?

Gets the next valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.

GetNextValidSpan ( HexPosition position, bool fullSpan ) : HexSpan?

Gets the next valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.

GetPreviousValidSpan ( HexPosition position, HexPosition lowerBounds, bool fullSpan ) : HexSpan?

Gets the previous valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.

GetPreviousValidSpan ( HexPosition position, bool fullSpan ) : HexSpan?

Gets the previous valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.

GetSpanInfo ( HexPosition position ) : HexSpanInfo

Gets information about a position in the buffer. The returned info isn't normalized, there may be consecutive spans with the same flags. It's the responsibility of the caller to merge such spans.

GetValidSpans ( ) : IEnumerable

Gets all valid spans. This could be empty if it's a 0-byte buffer stream. This method merges all consecutive valid spans.

GetValidSpans ( HexSpan span, bool fullSpan ) : IEnumerable

Gets all valid spans overlapping span. This method merges all consecutive valid spans.

ReadByte ( HexPosition position ) : byte

Reads a byte

ReadBytes ( HexPosition position, long length ) : byte[]

Reads bytes

ReadBytes ( HexPosition position, ulong length ) : byte[]

Reads bytes

ReadBytes ( HexSpan span ) : byte[]

Reads bytes

ReadBytes ( HexPosition position, byte destination ) : void

Reads bytes

ReadBytes ( HexPosition position, byte destination, long destinationIndex, long length ) : void

Reads bytes

ReadDouble ( HexPosition position ) : double

Reads a double

ReadHexBytes ( HexPosition position, long length ) : dnSpy.Contracts.Hex.HexBytes

Reads bytes

ReadInt16 ( HexPosition position ) : short

Reads a short

ReadInt32 ( HexPosition position ) : int

Reads a int

ReadInt64 ( HexPosition position ) : long

Reads a long

ReadSByte ( HexPosition position ) : sbyte

Reads a sbyte

ReadSingle ( HexPosition position ) : float

Reads a float

ReadUInt16 ( HexPosition position ) : ushort

Reads a ushort

ReadUInt32 ( HexPosition position ) : uint

Reads a uint

ReadUInt64 ( HexPosition position ) : ulong

Reads a ulong

Refresh ( ) : void

Clears any read caches and raises BufferSpanInvalidated if needed

Replace ( HexPosition position, byte value ) : void

Replaces the byte at position with value

Replace ( HexPosition position, byte data, long index, long length ) : void

Replaces the data at position with data

Replace ( HexPosition position, double value ) : void

Replaces the double at position with value

Replace ( HexPosition position, float value ) : void

Replaces the float at position with value

Replace ( HexPosition position, int value ) : void

Replaces the int at position with value

Replace ( HexPosition position, long value ) : void

Replaces the long at position with value

Replace ( HexPosition position, sbyte value ) : void

Replaces the sbyte at position with value

Replace ( HexPosition position, short value ) : void

Replaces the short at position with value

Replace ( HexPosition position, uint value ) : void

Replaces the uint at position with value

Replace ( HexPosition position, ulong value ) : void

Replaces the ulong at position with value

Replace ( HexPosition position, ushort value ) : void

Replaces the ushort at position with value

TakeThreadOwnership ( ) : void

Claims ownership of this buffer for the current thread

TryReadByte ( HexPosition position ) : int

Tries to read a byte. If there's no data, a value less than 0 is returned.

보호된 메소드들

메소드 설명
DisposeCore ( ) : void

Disposes this instance

HexBuffer ( HexTags tags ) : System

Constructor

비공개 메소드들

메소드 설명
GetStartOfData ( HexPosition start, bool validData ) : HexPosition
GetStartOfDataCore ( HexPosition start, bool validData ) : HexPosition

메소드 상세

CheckEditAccess() 공개 추상적인 메소드

Returns true if the current thread is allowed to modify the buffer
public abstract CheckEditAccess ( ) : bool
리턴 bool

CreateEdit() 공개 추상적인 메소드

Creates a HexEdit object
public abstract CreateEdit ( ) : dnSpy.Contracts.Hex.HexEdit
리턴 dnSpy.Contracts.Hex.HexEdit

CreateEdit() 공개 추상적인 메소드

Creates a HexEdit object
public abstract CreateEdit ( int reiteratedVersionNumber, object editTag ) : dnSpy.Contracts.Hex.HexEdit
reiteratedVersionNumber int Use by undo/redo to restore a previous version
editTag object Edit tag, can be anything
리턴 dnSpy.Contracts.Hex.HexEdit

Dispose() 공개 메소드

Disposes this instance
public Dispose ( ) : void
리턴 void

DisposeCore() 보호된 메소드

Disposes this instance
protected DisposeCore ( ) : void
리턴 void

GetNextValidSpan() 공개 메소드

Gets the next valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.
public GetNextValidSpan ( HexPosition position, HexPosition upperBounds, bool fullSpan ) : HexSpan?
position HexPosition Start position to check
upperBounds HexPosition End position
fullSpan bool true if positions before should be included /// in the returned result. This could result in worse performance.
리턴 HexSpan?

GetNextValidSpan() 공개 메소드

Gets the next valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.
public GetNextValidSpan ( HexPosition position, bool fullSpan ) : HexSpan?
position HexPosition Start position to check
fullSpan bool true if positions before should be included /// in the returned result. This could result in worse performance.
리턴 HexSpan?

GetPreviousValidSpan() 공개 메소드

Gets the previous valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.
public GetPreviousValidSpan ( HexPosition position, HexPosition lowerBounds, bool fullSpan ) : HexSpan?
position HexPosition Start position to check
lowerBounds HexPosition End position
fullSpan bool true if positions after should be included /// in the returned result. This could result in worse performance.
리턴 HexSpan?

GetPreviousValidSpan() 공개 메소드

Gets the previous valid span or null if there's none left. This includes the input (position) if it happens to lie within this valid span. This method merges all consecutive valid spans.
public GetPreviousValidSpan ( HexPosition position, bool fullSpan ) : HexSpan?
position HexPosition Start position to check
fullSpan bool true if positions after should be included /// in the returned result. This could result in worse performance.
리턴 HexSpan?

GetSpanInfo() 공개 추상적인 메소드

Gets information about a position in the buffer. The returned info isn't normalized, there may be consecutive spans with the same flags. It's the responsibility of the caller to merge such spans.
public abstract GetSpanInfo ( HexPosition position ) : HexSpanInfo
position HexPosition Position
리턴 HexSpanInfo

GetValidSpans() 공개 메소드

Gets all valid spans. This could be empty if it's a 0-byte buffer stream. This method merges all consecutive valid spans.
public GetValidSpans ( ) : IEnumerable
리턴 IEnumerable

GetValidSpans() 공개 메소드

Gets all valid spans overlapping span. This method merges all consecutive valid spans.
public GetValidSpans ( HexSpan span, bool fullSpan ) : IEnumerable
span HexSpan Span
fullSpan bool true if positions before should be included /// in the returned result. This could result in worse performance.
리턴 IEnumerable

HexBuffer() 보호된 메소드

Constructor
protected HexBuffer ( HexTags tags ) : System
tags HexTags
리턴 System

ReadByte() 공개 추상적인 메소드

Reads a byte
public abstract ReadByte ( HexPosition position ) : byte
position HexPosition Position
리턴 byte

ReadBytes() 공개 추상적인 메소드

Reads bytes
public abstract ReadBytes ( HexPosition position, long length ) : byte[]
position HexPosition Position
length long Number of bytes to read
리턴 byte[]

ReadBytes() 공개 추상적인 메소드

Reads bytes
public abstract ReadBytes ( HexPosition position, ulong length ) : byte[]
position HexPosition Position
length ulong Number of bytes to read
리턴 byte[]

ReadBytes() 공개 추상적인 메소드

Reads bytes
public abstract ReadBytes ( HexSpan span ) : byte[]
span HexSpan Span
리턴 byte[]

ReadBytes() 공개 메소드

Reads bytes
public ReadBytes ( HexPosition position, byte destination ) : void
position HexPosition Position
destination byte Destination array
리턴 void

ReadBytes() 공개 추상적인 메소드

Reads bytes
public abstract ReadBytes ( HexPosition position, byte destination, long destinationIndex, long length ) : void
position HexPosition Position
destination byte Destination array
destinationIndex long Index
length long Length
리턴 void

ReadDouble() 공개 추상적인 메소드

Reads a double
public abstract ReadDouble ( HexPosition position ) : double
position HexPosition Position
리턴 double

ReadHexBytes() 공개 추상적인 메소드

Reads bytes
public abstract ReadHexBytes ( HexPosition position, long length ) : dnSpy.Contracts.Hex.HexBytes
position HexPosition Position
length long Length
리턴 dnSpy.Contracts.Hex.HexBytes

ReadInt16() 공개 추상적인 메소드

Reads a short
public abstract ReadInt16 ( HexPosition position ) : short
position HexPosition Position
리턴 short

ReadInt32() 공개 추상적인 메소드

Reads a int
public abstract ReadInt32 ( HexPosition position ) : int
position HexPosition Position
리턴 int

ReadInt64() 공개 추상적인 메소드

Reads a long
public abstract ReadInt64 ( HexPosition position ) : long
position HexPosition Position
리턴 long

ReadSByte() 공개 추상적인 메소드

Reads a sbyte
public abstract ReadSByte ( HexPosition position ) : sbyte
position HexPosition Position
리턴 sbyte

ReadSingle() 공개 추상적인 메소드

Reads a float
public abstract ReadSingle ( HexPosition position ) : float
position HexPosition Position
리턴 float

ReadUInt16() 공개 추상적인 메소드

Reads a ushort
public abstract ReadUInt16 ( HexPosition position ) : ushort
position HexPosition Position
리턴 ushort

ReadUInt32() 공개 추상적인 메소드

Reads a uint
public abstract ReadUInt32 ( HexPosition position ) : uint
position HexPosition Position
리턴 uint

ReadUInt64() 공개 추상적인 메소드

Reads a ulong
public abstract ReadUInt64 ( HexPosition position ) : ulong
position HexPosition Position
리턴 ulong

Refresh() 공개 추상적인 메소드

Clears any read caches and raises BufferSpanInvalidated if needed
public abstract Refresh ( ) : void
리턴 void

Replace() 공개 메소드

Replaces the byte at position with value
public Replace ( HexPosition position, byte value ) : void
position HexPosition Position
value byte New value
리턴 void

Replace() 공개 메소드

Replaces the data at position with data
public Replace ( HexPosition position, byte data, long index, long length ) : void
position HexPosition Position
data byte New data
index long Index
length long Length
리턴 void

Replace() 공개 메소드

Replaces the double at position with value
public Replace ( HexPosition position, double value ) : void
position HexPosition Position
value double New value
리턴 void

Replace() 공개 메소드

Replaces the float at position with value
public Replace ( HexPosition position, float value ) : void
position HexPosition Position
value float New value
리턴 void

Replace() 공개 메소드

Replaces the int at position with value
public Replace ( HexPosition position, int value ) : void
position HexPosition Position
value int New value
리턴 void

Replace() 공개 메소드

Replaces the long at position with value
public Replace ( HexPosition position, long value ) : void
position HexPosition Position
value long New value
리턴 void

Replace() 공개 메소드

Replaces the sbyte at position with value
public Replace ( HexPosition position, sbyte value ) : void
position HexPosition Position
value sbyte New value
리턴 void

Replace() 공개 메소드

Replaces the short at position with value
public Replace ( HexPosition position, short value ) : void
position HexPosition Position
value short New value
리턴 void

Replace() 공개 메소드

Replaces the uint at position with value
public Replace ( HexPosition position, uint value ) : void
position HexPosition Position
value uint New value
리턴 void

Replace() 공개 메소드

Replaces the ulong at position with value
public Replace ( HexPosition position, ulong value ) : void
position HexPosition Position
value ulong New value
리턴 void

Replace() 공개 메소드

Replaces the ushort at position with value
public Replace ( HexPosition position, ushort value ) : void
position HexPosition Position
value ushort New value
리턴 void

TakeThreadOwnership() 공개 추상적인 메소드

Claims ownership of this buffer for the current thread
public abstract TakeThreadOwnership ( ) : void
리턴 void

TryReadByte() 공개 추상적인 메소드

Tries to read a byte. If there's no data, a value less than 0 is returned.
public abstract TryReadByte ( HexPosition position ) : int
position HexPosition Position
리턴 int