ASN1C C# Runtime Library  7.7
Public Member Functions | Static Public Member Functions | Properties | List of all members
Diag Class Reference

Public Member Functions

virtual bool IsEnabled ()
 
virtual bool IsEnabled (int traceLevel)
 
virtual void Println (System.String s)
 
virtual void Println (System.String s, int traceLevel)
 
virtual bool SetEnabled (bool data)
 
virtual int SetTraceLevel2 (int level)
 

Static Public Member Functions

static void HexDump (byte[] bytes)
 
static void HexDump (byte[] bytes, int traceLevel)
 
static void HexDump (System.IO.Stream istrm, System.IO.StreamWriter ostrm)
 
static Diag Instance ()
 
static void Prtln (System.String s)
 
static void Prtln (System.String s, int traceLevel)
 
static void Prtln (byte[] b, int offset, int nbytes, int tl)
 
static void Prtln (byte[] b, int offset, int nbytes)
 
static int SetTraceLevel (int level)
 

Properties

virtual System.IO.StreamWriter PrintStream [set]
 

Detailed Description

This class is used for printing diagnostic messages for debugging the run-time components. It allows messages to be easily switched on and off.

Member Function Documentation

◆ HexDump() [1/3]

static void HexDump ( byte []  bytes)
static

This method prints a formatted hex dump for the contents of the given byte array to the standard output stream.

Parameters
bytesByte array containg data to be dumped

References Diag.HexDump().

Referenced by Diag.HexDump(), and Asn1MessageBufferBase.SetPermanentKey().

◆ HexDump() [2/3]

static void HexDump ( byte []  bytes,
int  traceLevel 
)
static

This method prints a formatted hex dump for the contents of the given byte array to the standard output stream, if the given trace level is enabled.

Parameters
bytesByte array containg data to be dumped
traceLevelTrace level

References Diag.HexDump(), and Diag.IsEnabled().

◆ HexDump() [3/3]

static void HexDump ( System.IO.Stream  istrm,
System.IO.StreamWriter  ostrm 
)
static

This method prints a formatted hex dump for the contents of the given input stream to the given output stream.

Parameters
istrmInput Stream containg data to be dumped
ostrmOutput Stream to which formatted data is to be written

References Diag.IsEnabled().

◆ Instance()

static Diag Instance ( )
static

This method provides the current instance of the Diag Class

Returns
Current instance of the Diag class

Referenced by Asn1Type.Indent(), Diag.Prtln(), Asn1MessageBufferBase.SetPermanentKey(), and Diag.SetTraceLevel().

◆ IsEnabled() [1/2]

virtual bool IsEnabled ( )
virtual

This method will enable the diagnostic message printing.

Returns
true if enabled, else false

Referenced by Diag.HexDump(), and Diag.Prtln().

◆ IsEnabled() [2/2]

virtual bool IsEnabled ( int  traceLevel)
virtual

This method checks that given trace level message will be printed.

Parameters
traceLevelTrace Level
Returns
true if enabled, else false

◆ Println() [1/2]

virtual void Println ( System.String  s)
virtual

This method prints a the diagnsotic message

Parameters
sdiagnsotic message

Referenced by Asn1Type.Indent(), and Diag.Prtln().

◆ Println() [2/2]

virtual void Println ( System.String  s,
int  traceLevel 
)
virtual

This method prints a the diagnsotic message, if given trace level is enabled

Parameters
sdiagnsotic message
traceLevelTrace Level

◆ Prtln() [1/4]

static void Prtln ( System.String  s)
static

This method prints a the diagnsotic message to current Diag class instance.

Parameters
sdiagnsotic message

References Diag.Instance(), and Diag.Println().

Referenced by Asn1BerDecodeContext.Asn1BerDecodeContext(), Asn1BitString.BaseDecode(), Asn1XmlAnyElem.XsdAnySaxHandler.Characters(), Asn1OpenType.SaxHandler.Characters(), Asn1OctetString.CompareTo(), Asn1Real.Decode(), Asn1X694OrderElement.Decode(), Asn1Integer.Decode(), Asn1UniversalString.Decode(), Asn1DecodeBitBuffer.DecodeBitsToLong(), Asn1DecodeBitBuffer.DecodeBitsToOctetArray(), Asn1PerDecodeBuffer.DecodeConsWholeNumber(), Asn1BerDecodeBuffer.DecodeLength(), Asn1PerDecodeBuffer.DecodeSmallLength(), Asn1PerDecodeBuffer.DecodeSmallNonNegWholeNumber(), Asn1BerDecodeBuffer.DecodeTag(), Asn1PerDecodeBuffer.DecodeUnconsLength(), Asn1BigInteger.DecodeValue(), Asn1Integer.DecodeValue(), Asn1RelativeOID.DecodeXML(), Asn1RelativeOID.Encode(), Asn1Enumerated.Encode(), Asn1ObjectIdentifier.Encode(), Asn1UTF8String.Encode(), Asn1X694OrderElement.Encode(), Asn1Real.Encode(), Asn1UniversalString.Encode(), Asn1PerEncodeBuffer.EncodeCharString(), Asn1PerEncodeBuffer.EncodeConsWholeNumber(), Asn1PerEncodeBuffer.EncodeInt(), Asn1BerEncodeBuffer.EncodeIntValue(), Asn1BerOutputStream.EncodeIntValue(), Asn1PerEncodeBuffer.EncodeOIDLengthAndValue(), Asn1PerEncodeBuffer.EncodeRelOIDLengthAndValue(), Asn1PerEncodeBuffer.EncodeSmallLength(), Asn1PerEncodeBuffer.EncodeSmallNonNegWholeNumber(), Asn1BerEncodeBuffer.EncodeUnsignedBinaryNumber(), Asn1BerOutputStream.EncodeUnsignedBinaryNumber(), Asn1Integer.EncodeValue(), Asn1XmlAnyElem.XsdAnySaxHandler.EndElement(), Asn1OpenType.SaxHandler.EndElement(), Asn1DiscreteCharSet.GetCharAtIndex(), Asn1PerTraceHandler.NewBitField(), Asn1Real.NormalizedRealValueToString(), Asn1Value.ParseString(), Asn1PerBitFieldPrinter.Print(), Asn1DecodeBuffer.Read(), Asn1RelativeOID.Skip(), Asn1ObjectIdentifier.Skip(), Asn1OctetString.Skip(), Asn1BitString.Skip(), Asn1XmlAnyElem.XsdAnySaxHandler.StartElement(), Asn1OpenType.SaxHandler.StartElement(), Asn1ObjectIdentifier.ToString(), Asn1BitString.ToString(), and Asn1CharString.validate().

◆ Prtln() [2/4]

static void Prtln ( System.String  s,
int  traceLevel 
)
static

This method prints a the diagnsotic message to current Diag class instance, if given trace level is enabled

Parameters
sdiagnsotic message
traceLevelTrace Level

References Diag.Instance(), and Diag.Println().

◆ Prtln() [3/4]

static void Prtln ( byte []  b,
int  offset,
int  nbytes,
int  tl 
)
static

This method prints a the hex dump of the given byte array to current Diag class instance, if given trace level is enabled

Parameters
bbyte array containing data
offsetstart offset in the byte array
nbytesno of bytes to be printed
tltrace level

References Diag.Instance(), and Diag.IsEnabled().

◆ Prtln() [4/4]

static void Prtln ( byte []  b,
int  offset,
int  nbytes 
)
static

This method prints a the hex dump of the given byte array to current Diag class instance

Parameters
bbyte array containing data
offsetstart offset in the byte array
nbytesno of bytes to be printed

References Diag.Instance(), Diag.IsEnabled(), and Asn1Util.ToHexString().

◆ SetEnabled()

virtual bool SetEnabled ( bool  data)
virtual

This method enables or disables the diagnostic message priting.

Parameters
datatrue for enabling printing; otherwise false
Returns
The stat before setting this stat

Referenced by Asn1MessageBufferBase.SetPermanentKey().

◆ SetTraceLevel()

static int SetTraceLevel ( int  level)
static

This method sets the trace level for the current instance of the Diag Class

Parameters
levelTrace Level
Returns
Set trace level

References Diag.Instance(), and Diag.SetTraceLevel2().

◆ SetTraceLevel2()

virtual int SetTraceLevel2 ( int  level)
virtual

This method sets the trace level for this class

Parameters
levelTrace Level
Returns
Set trace level

Referenced by Diag.SetTraceLevel().

Property Documentation

◆ PrintStream

virtual System.IO.StreamWriter PrintStream
set

Sets the System.IO.StreamWriter object to which the diagnostic messages should be written.

Value: Output stream for diagnostic messages