C# Class FSSHTTPandWOPIInspector.Parsers.BaseStructure

Exibir arquivo Open project: OfficeDev/Office-Inspectors-for-Fiddler

Public Methods

Method Description
AddNumberForTreeNode ( TreeNode treenode, int index ) : TreeNode

Add a number attribute for treenode

AddserialNumForFSSHTTPBTreeNode ( TreeNode treenode, int &index ) : TreeNode

Add a serial number only for treenodes which are FSSHTTPB structures

ArrayObjectToNode ( object obj, object parentobj, FieldInfo Info, int &startIndex, int &offset ) : TreeNode

Convert object array to TreeNode

ArrayObjectToNode ( object obj, string name ) : TreeNode

Convert object array to TreeNode

ContainsStreamObjectHeader ( ushort headerType ) : bool

specify whether stream contains Stream Object Header

ContainsStreamObjectStart32BitHeader ( ushort headerType ) : bool

specify whether stream contains Stream Object Start 32Bit Header

GetBigEnidan ( int byteNumber ) : long

read bytes from stream to long in big enidan.

GetBits ( byte b, int index, int length ) : byte

Read bits value from byte

GetBits ( int b, int index, int length ) : uint

Read bits value from byte

GetBits ( long b, int index, int length ) : ulong

Read bits value from byte

GetBits ( short b, int index, int length ) : ushort

Read bits value from byte

GetExtendedGUIDBytesLen ( int byteOffset ) : int

Get the length of the ExtenedGUID

GetSerialNumberBytesLen ( int byteOffset ) : int

Get the length of the SerialNumber

ObjectToTreeNode ( object obj, int &startIndex, int &offset ) : TreeNode

Add the object to TreeNode and calculate the byte number it consumed

ObjectToTreeNode ( object obj, string ropNameforBinaryStrucutre ) : TreeNode

Convert object to TreeNode

Parse ( Stream s ) : void

Parse stream to specific message

PreReadDataElementPackageType ( ) : long

Get DataElementPackage Type

ReadCompactUnsigned64bitIntegerValue ( int byteOffset ) : long

Read CompactUnsigned64bitInteger from stream

ReadINT64 ( ) : long

Read an long value from stream

RemoveAnySpecifiedTreeNode ( TreeNode treenode ) : TreeNode

Remove subNode which node text contains "specified"

RemoveDefaultValueTreeNode ( TreeNode &node, string specifiedText ) : void

Remove subNode which contains defaut value(for optinal element)

SimpleTypeObjectToNode ( object obj, object parentobj, FieldInfo Info, int &startIndex, int &offset ) : TreeNode

Convert simple type object to TreeNode

SimpleTypeObjectToNode ( object obj, string name ) : TreeNode

Convert simple type object to TreeNode

ToString ( ) : string

Override the ToString method to return empty.

Protected Methods

Method Description
CurrentByte ( ) : byte

Get the current byte of stream

Read3Bytes ( ) : int

Read an three bytes value as uint from stream

Read5Bytes ( ) : long

Read an five bytes value as ulong from stream

Read6Bytes ( ) : long

Read an six bytes value as ulong from stream

Read7Bytes ( ) : long

Read an seven bytes value as ulong from stream

ReadBoolean ( ) : System.Boolean

Read an Boolean value from stream

ReadByte ( ) : byte

Read a byte value from stream

ReadBytes ( int length ) : byte[]

Read bytes from stream

ReadChar ( Encoding encoding ) : char

Read character from stream

ReadGuid ( ) : System.Guid

Read a GUID value from stream

ReadINT16 ( ) : Int16

Read an Int16 value from stream

ReadINT32 ( ) : Int32

Read an Int32 value from stream

ReadString ( Encoding encoding, string terminator = "\0", int stringlength, bool reducedUnicode = false ) : string

Read string value from stream according to string terminator and Encoding method

ReadUint ( ) : uint

Read an uint value from stream

ReadUlong ( ) : ulong

Read an uLong value from stream

ReadUshort ( ) : ushort

Read an ushort value from stream

Private Methods

Method Description
ConvertFromBytes ( byte buffer, int bytesToConvert ) : ulong

Returns a value built from the specified number of bytes from the given buffer

Method Details

AddNumberForTreeNode() public static method

Add a number attribute for treenode
public static AddNumberForTreeNode ( TreeNode treenode, int index ) : TreeNode
treenode System.Windows.Forms.TreeNode treenode which used to add number
index int the number
return System.Windows.Forms.TreeNode

AddserialNumForFSSHTTPBTreeNode() public static method

Add a serial number only for treenodes which are FSSHTTPB structures
public static AddserialNumForFSSHTTPBTreeNode ( TreeNode treenode, int &index ) : TreeNode
treenode System.Windows.Forms.TreeNode treenode which used to add serial number
index int the serial number
return System.Windows.Forms.TreeNode

ArrayObjectToNode() public static method

Convert object array to TreeNode
public static ArrayObjectToNode ( object obj, object parentobj, FieldInfo Info, int &startIndex, int &offset ) : TreeNode
obj object The object which need to convert
parentobj object The parent object of the object which need to convert
Info System.Reflection.FieldInfo The field Info of the object in parent object
startIndex int The start index of this object in message stream
offset int The offset of this object
return System.Windows.Forms.TreeNode

ArrayObjectToNode() public static method

Convert object array to TreeNode
public static ArrayObjectToNode ( object obj, string name ) : TreeNode
obj object The object which need to convert
name string The name of the node
return System.Windows.Forms.TreeNode

ContainsStreamObjectHeader() public method

specify whether stream contains Stream Object Header
public ContainsStreamObjectHeader ( ushort headerType ) : bool
headerType ushort a ushort indicate the type of the stream object header
return bool

ContainsStreamObjectStart32BitHeader() public method

specify whether stream contains Stream Object Start 32Bit Header
public ContainsStreamObjectStart32BitHeader ( ushort headerType ) : bool
headerType ushort a ushort indicate the type of the 32 bit stream object header
return bool

CurrentByte() protected method

Get the current byte of stream
protected CurrentByte ( ) : byte
return byte

GetBigEnidan() public method

read bytes from stream to long in big enidan.
public GetBigEnidan ( int byteNumber ) : long
byteNumber int byte number need to read
return long

GetBits() public method

Read bits value from byte
public GetBits ( byte b, int index, int length ) : byte
b byte The byte.
index int The bit index to read
length int The bit length to read
return byte

GetBits() public method

Read bits value from byte
public GetBits ( int b, int index, int length ) : uint
b int The int value used to get bit.
index int The bit index to read
length int The bit length to read
return uint

GetBits() public method

Read bits value from byte
public GetBits ( long b, int index, int length ) : ulong
b long The long value used to get bit.
index int The bit index to read
length int The bit length to read
return ulong

GetBits() public method

Read bits value from byte
public GetBits ( short b, int index, int length ) : ushort
b short The short value used to get bit.
index int The bit index to read
length int The bit length to read
return ushort

GetExtendedGUIDBytesLen() public method

Get the length of the ExtenedGUID
public GetExtendedGUIDBytesLen ( int byteOffset ) : int
byteOffset int the offset from the current position of the stream
return int

GetSerialNumberBytesLen() public method

Get the length of the SerialNumber
public GetSerialNumberBytesLen ( int byteOffset ) : int
byteOffset int the offset from the current position of the stream
return int

ObjectToTreeNode() public static method

Add the object to TreeNode and calculate the byte number it consumed
public static ObjectToTreeNode ( object obj, int &startIndex, int &offset ) : TreeNode
obj object The object need to display in TreeView
startIndex int The start position of the object in HexView
offset int The byte number consumed by the object
return System.Windows.Forms.TreeNode

ObjectToTreeNode() public static method

Convert object to TreeNode
public static ObjectToTreeNode ( object obj, string ropNameforBinaryStrucutre ) : TreeNode
obj object The object need to convet
ropNameforBinaryStrucutre string The object need to convet
return System.Windows.Forms.TreeNode

Parse() public method

Parse stream to specific message
public Parse ( Stream s ) : void
s Stream Stream to parse
return void

PreReadDataElementPackageType() public method

Get DataElementPackage Type
public PreReadDataElementPackageType ( ) : long
return long

Read3Bytes() protected method

Read an three bytes value as uint from stream
protected Read3Bytes ( ) : int
return int

Read5Bytes() protected method

Read an five bytes value as ulong from stream
protected Read5Bytes ( ) : long
return long

Read6Bytes() protected method

Read an six bytes value as ulong from stream
protected Read6Bytes ( ) : long
return long

Read7Bytes() protected method

Read an seven bytes value as ulong from stream
protected Read7Bytes ( ) : long
return long

ReadBoolean() protected method

Read an Boolean value from stream
protected ReadBoolean ( ) : System.Boolean
return System.Boolean

ReadByte() protected method

Read a byte value from stream
protected ReadByte ( ) : byte
return byte

ReadBytes() protected method

Read bytes from stream
protected ReadBytes ( int length ) : byte[]
length int The byte length to read
return byte[]

ReadChar() protected method

Read character from stream
protected ReadChar ( Encoding encoding ) : char
encoding System.Text.Encoding The text encoding
return char

ReadCompactUnsigned64bitIntegerValue() public method

Read CompactUnsigned64bitInteger from stream
public ReadCompactUnsigned64bitIntegerValue ( int byteOffset ) : long
byteOffset int the offset from the current position of the stream
return long

ReadGuid() protected method

Read a GUID value from stream
protected ReadGuid ( ) : System.Guid
return System.Guid

ReadINT16() protected method

Read an Int16 value from stream
protected ReadINT16 ( ) : Int16
return System.Int16

ReadINT32() protected method

Read an Int32 value from stream
protected ReadINT32 ( ) : Int32
return System.Int32

ReadINT64() public method

Read an long value from stream
public ReadINT64 ( ) : long
return long

ReadString() protected method

Read string value from stream according to string terminator and Encoding method
protected ReadString ( Encoding encoding, string terminator = "\0", int stringlength, bool reducedUnicode = false ) : string
encoding System.Text.Encoding The character Encoding
terminator string The string terminator
stringlength int
reducedUnicode bool True means reduced Unicode character string. The terminating null character is one zero byte.
return string

ReadUint() protected method

Read an uint value from stream
protected ReadUint ( ) : uint
return uint

ReadUlong() protected method

Read an uLong value from stream
protected ReadUlong ( ) : ulong
return ulong

ReadUshort() protected method

Read an ushort value from stream
protected ReadUshort ( ) : ushort
return ushort

RemoveAnySpecifiedTreeNode() public static method

Remove subNode which node text contains "specified"
public static RemoveAnySpecifiedTreeNode ( TreeNode treenode ) : TreeNode
treenode System.Windows.Forms.TreeNode The tree node used to remove sub node
return System.Windows.Forms.TreeNode

RemoveDefaultValueTreeNode() public static method

Remove subNode which contains defaut value(for optinal element)
public static RemoveDefaultValueTreeNode ( TreeNode &node, string specifiedText ) : void
node System.Windows.Forms.TreeNode The tree node used to remove sub node
specifiedText string the specified text
return void

SimpleTypeObjectToNode() public static method

Convert simple type object to TreeNode
public static SimpleTypeObjectToNode ( object obj, object parentobj, FieldInfo Info, int &startIndex, int &offset ) : TreeNode
obj object The object which need to convert
parentobj object The parent object of the object which need to convert
Info System.Reflection.FieldInfo The field Info of the object in parent object
startIndex int The start index of this object in message stream
offset int The offset of this object
return System.Windows.Forms.TreeNode

SimpleTypeObjectToNode() public static method

Convert simple type object to TreeNode
public static SimpleTypeObjectToNode ( object obj, string name ) : TreeNode
obj object The object which need to convert
name string The name of the child node
return System.Windows.Forms.TreeNode

ToString() public method

Override the ToString method to return empty.
public ToString ( ) : string
return string