C# Class BACnet.Tagging.TagReader

Show file Open project: LorenVS/bacstack Class Usage Examples

Public Methods

Method Description
AtCloseTag ( byte tag ) : bool

Checks whether the next tag is a close tag with a certain tag number

AtOpenTag ( byte tag ) : bool

Checks whether the next tag is an open tag with a certain tag number

AtTag ( byte tag, ApplicationTag defaultTag ) : bool

Checks whether the next tag to be read matches a certain tag

EOF ( ) : bool

Determines whether the reader is at the end of the stream

ReadBitString24 ( byte tag = 255 ) : BitString24

Reads a bitstring tag from the stream

ReadBitString56 ( byte tag = 255 ) : BitString56

Reads a bitstring tag from the stream

ReadBitString8 ( byte tag = 255 ) : BitString8

Reads a bitstring tag from the stream

ReadBoolean ( byte tag = 255 ) : bool

Reads a boolean tag from the stream

ReadCharString ( byte tag = 255 ) : string

Reads a char string tag from the stream

ReadCloseTag ( byte tag ) : void

Reads a close tag from the stream

ReadDate ( byte tag = 255 ) : Date

Reads a date tag from the stream

ReadEnumerated ( byte tag = 255 ) : uint

Reads an enumerated tag from the stream

ReadFloat32 ( byte tag = 255 ) : float

Reads a float32 tag from the stream

ReadFloat64 ( byte tag = 255 ) : double

Reads a float64 tag from the stream

ReadGeneric ( byte tag = 255 ) : GenericValue

Reads a generic value from the stream

ReadNull ( byte tag = 255 ) : System.Null

Reads a null tag from the stream

ReadObjectId ( byte tag = 255 ) : ObjectId

Reads an object id tag from the stream

ReadOctetString ( byte tag = 255 ) : byte[]

Reads an octet string tag from the stream

ReadOpenTag ( byte tag ) : void

Reads an open tag from the stream

ReadSigned16 ( byte tag = 255 ) : short

Reads a signed tag from the stream

ReadSigned32 ( byte tag = 255 ) : int

Reads a signed tag from the stream

ReadSigned64 ( byte tag = 255 ) : long

Reads a signed tag from the stream

ReadSigned8 ( byte tag = 255 ) : sbyte

Reads a signed tag from the stream

ReadTime ( byte tag = 255 ) : Time

Reads a time tag from the stream

ReadUnsigned16 ( byte tag = 255 ) : ushort

Reads an unsigned tag from the stream

ReadUnsigned32 ( byte tag = 255 ) : uint

Reads an unsigned tag from the stream

ReadUnsigned64 ( byte tag = 255 ) : ulong

Reads an unsigned tag from the stream

ReadUnsigned8 ( byte tag = 255 ) : byte

Reads an unsigned tag from the stream

TagReader ( Stream stream ) : System

Constructs a new TagReader instance

Private Methods

Method Description
_ensureLVT ( LVT lvt ) : void

Ensures that the current tag lvt is an expected value

_ensureLength ( int length ) : void

Ensures that the current tag length is an expected value

_ensureLength ( int min, int max ) : void

Ensures that the current tag length falls within an expected range

_ensureTag ( byte tag ) : void

Ensures that the current tag meets an expected tag value

_ensureTag ( byte tag, ApplicationTag defaultTag ) : void

Ensures that the current tag meets an expected tag value

_ensureType ( TagType type ) : void

Ensures that the type of the read tag is an expected value

_nextHeader ( ) : void

Reads the next header from the input stream

_peekHeader ( ) : bool

Peeks at the next tag header, without consuming it

_readHeader ( ) : bool

Reads the next header from the input stream if it hasn't already been read

Method Details

AtCloseTag() public method

Checks whether the next tag is a close tag with a certain tag number
public AtCloseTag ( byte tag ) : bool
tag byte The tag number to check for, or 255 for no tag
return bool

AtOpenTag() public method

Checks whether the next tag is an open tag with a certain tag number
public AtOpenTag ( byte tag ) : bool
tag byte The tag number to check for, or 255 for no tag
return bool

AtTag() public method

Checks whether the next tag to be read matches a certain tag
public AtTag ( byte tag, ApplicationTag defaultTag ) : bool
tag byte The tag number to check for, or 255 for an application tag
defaultTag ApplicationTag The application tag to check for
return bool

EOF() public method

Determines whether the reader is at the end of the stream
public EOF ( ) : bool
return bool

ReadBitString24() public method

Reads a bitstring tag from the stream
public ReadBitString24 ( byte tag = 255 ) : BitString24
tag byte The tag number of the bitstring tag, or 255 for an application tag
return BACnet.Types.BitString24

ReadBitString56() public method

Reads a bitstring tag from the stream
public ReadBitString56 ( byte tag = 255 ) : BitString56
tag byte The tag number of the bitstring tag, or 255 for an application tag
return BACnet.Types.BitString56

ReadBitString8() public method

Reads a bitstring tag from the stream
public ReadBitString8 ( byte tag = 255 ) : BitString8
tag byte The tag number of the bitstring tag, or 255 for an application tag
return BACnet.Types.BitString8

ReadBoolean() public method

Reads a boolean tag from the stream
public ReadBoolean ( byte tag = 255 ) : bool
tag byte The tag number of the boolean tag, or 255 for an application tag
return bool

ReadCharString() public method

Reads a char string tag from the stream
public ReadCharString ( byte tag = 255 ) : string
tag byte The tag number of the char string tag, or 255 for an application tag
return string

ReadCloseTag() public method

Reads a close tag from the stream
public ReadCloseTag ( byte tag ) : void
tag byte The tag number of the close tag, or 255 for no close tag
return void

ReadDate() public method

Reads a date tag from the stream
public ReadDate ( byte tag = 255 ) : Date
tag byte The tag number of the date tag, or 255 for an application tag
return Date

ReadEnumerated() public method

Reads an enumerated tag from the stream
public ReadEnumerated ( byte tag = 255 ) : uint
tag byte The tag number of the enumerated tag, or 255 for an application tag
return uint

ReadFloat32() public method

Reads a float32 tag from the stream
public ReadFloat32 ( byte tag = 255 ) : float
tag byte The tag number of the float32 tag, or 255 for an application tag
return float

ReadFloat64() public method

Reads a float64 tag from the stream
public ReadFloat64 ( byte tag = 255 ) : double
tag byte The tag number of the float64 tag, or 255 for an application tag
return double

ReadGeneric() public method

Reads a generic value from the stream
public ReadGeneric ( byte tag = 255 ) : GenericValue
tag byte The tag number of the wrapping tags, or 255 for no wrapping tag
return GenericValue

ReadNull() public method

Reads a null tag from the stream
public ReadNull ( byte tag = 255 ) : System.Null
tag byte The tag number of the null tag, or 255 for an application tag
return System.Null

ReadObjectId() public method

Reads an object id tag from the stream
public ReadObjectId ( byte tag = 255 ) : ObjectId
tag byte The tag number of the object id tag, or 255 for an application tag
return ObjectId

ReadOctetString() public method

Reads an octet string tag from the stream
public ReadOctetString ( byte tag = 255 ) : byte[]
tag byte The tag number of the octet string tag, or 255 for an application tag
return byte[]

ReadOpenTag() public method

Reads an open tag from the stream
public ReadOpenTag ( byte tag ) : void
tag byte The tag number of the open tag, or 255 for no open tag
return void

ReadSigned16() public method

Reads a signed tag from the stream
public ReadSigned16 ( byte tag = 255 ) : short
tag byte The tag number of the signed tag, or 255 for an application tag
return short

ReadSigned32() public method

Reads a signed tag from the stream
public ReadSigned32 ( byte tag = 255 ) : int
tag byte The tag number of the signed tag, or 255 for an application tag
return int

ReadSigned64() public method

Reads a signed tag from the stream
public ReadSigned64 ( byte tag = 255 ) : long
tag byte The tag number of the signed tag, or 255 for an application tag
return long

ReadSigned8() public method

Reads a signed tag from the stream
public ReadSigned8 ( byte tag = 255 ) : sbyte
tag byte The tag number of the signed tag, or 255 for an application tag
return sbyte

ReadTime() public method

Reads a time tag from the stream
public ReadTime ( byte tag = 255 ) : Time
tag byte The tag number of the time tag, or 255 for an application tag
return BACnet.Types.Time

ReadUnsigned16() public method

Reads an unsigned tag from the stream
public ReadUnsigned16 ( byte tag = 255 ) : ushort
tag byte The tag number of the unsigned tag, or 255 for an application tag
return ushort

ReadUnsigned32() public method

Reads an unsigned tag from the stream
public ReadUnsigned32 ( byte tag = 255 ) : uint
tag byte The tag number of the unsigned tag, or 255 for an application tag
return uint

ReadUnsigned64() public method

Reads an unsigned tag from the stream
public ReadUnsigned64 ( byte tag = 255 ) : ulong
tag byte The tag number of the unsigned tag, or 255 for an application tag
return ulong

ReadUnsigned8() public method

Reads an unsigned tag from the stream
public ReadUnsigned8 ( byte tag = 255 ) : byte
tag byte The tag number of the unsigned tag, or 255 for an application tag
return byte

TagReader() public method

Constructs a new TagReader instance
public TagReader ( Stream stream ) : System
stream Stream The stream to read from
return System