Asn1CharString Class Reference

Inheritance diagram for Asn1CharString:
Asn1Type Asn1TypeIF Asn18BitCharString Asn1BMPString Asn1OID_IRI Asn1UTF8String Asn1VarWidthCharString Asn1AbstractTime Asn1Date Asn1DateTime Asn1Duration Asn1IA5String Asn1NumericString Asn1PrintableString Asn1Time Asn1TimeOfDay Asn1VisibleString Asn1RELATIVE_OID_IRI Asn1Real10 Asn1XmlAnyElem Asn1GeneralString Asn1GraphicString Asn1ObjectDescriptor Asn1T61String Asn1VideotexString

List of all members.

Public Member Functions

virtual void Decode (Asn1JsonDecodeBuffer buffer)
void DecodeByteToChar (Asn1OerDecodeBuffer buffer, int length)
virtual void DecodeXER (System.String buffer, System.String attrs)
override void DecodeXML (System.String buffer, System.String attrs)
virtual void Encode (Asn1JsonOutputStream outs)
override void Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix)
override void Encode (Asn1XerEncoder buffer, System.String elemName)
override bool Equals (System.Object value)
bool Equals (System.String value)
override int GetHashCode ()
override System.String ToString ()
bool validate (Asn1CharSet charSet)

Public Attributes

System.String mValue

Protected Member Functions

internal Asn1CharString (System.String data, short typeCode)
internal Asn1CharString (short typeCode)
virtual internal void Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper)
virtual internal void Decode (Asn1PerDecodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet)
virtual internal void Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength, Asn1Tag tag)
virtual internal void Encode (Asn1PerEncodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet, long lower, long upper)
virtual internal void Encode (Asn1PerEncodeBuffer buffer, int abpc, int ubpc, Asn1CharSet charSet)
virtual internal int Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging, Asn1Tag tag)

Static Protected Member Functions

static int Encode (Asn1BerEncodeBuffer buffer, String val, bool explicitTagging, Asn1Tag tag)

Protected Attributes

internal System.Text.StringBuilder mStringBuffer

Properties

override int Length [get]

Detailed Description

This is a container class for holding the components of an ASN.1 character string value. Subclasses are defined for all of the different string types.


Constructor & Destructor Documentation

internal Asn1CharString ( short  typeCode  )  [protected]

This constructor creates an empty string that can be used in a Decode method call to receive a string value.

Parameters:
typeCode Universal ID code for ASN.1 character string
internal Asn1CharString ( System.String  data,
short  typeCode 
) [protected]

This constructor initializes a character string from the given string data.

Parameters:
data Character string
typeCode Universal ID code for ASN.1 character string

Member Function Documentation

virtual void Decode ( Asn1JsonDecodeBuffer  buffer  )  [virtual]

Decode ASN.1 restricted character string from JSON.

virtual internal void Decode ( Asn1PerDecodeBuffer  buffer,
int  abpc,
int  ubpc,
Asn1CharSet  charSet,
long  lower,
long  upper 
) [protected, virtual]

This overloaded version of the Decode method decodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes a size constraint is present but no permitted alphabet constraint.

The decoded result is stored in the public mValue member variable.

Parameters:
buffer Decode message buffer object
abpc Number of bits per character (aligned)
ubpc Number of bits per character (unaligned)
charSet Object representing permitted alphabet constraint character set (optional)
lower Effective size constraint lower bound
upper Effective size constraint upper bound
virtual internal void Decode ( Asn1PerDecodeBuffer  buffer,
int  abpc,
int  ubpc,
Asn1CharSet  charSet 
) [protected, virtual]

This method decodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes that a permitted alphabet constraint has been specified that would reduce the the number of bits-per-character from the default character set. It also assumes a general length determinant is present (i.e. there is not size constraint). The decoded result is stored in the public mValue member variable.

Parameters:
buffer Decode message buffer object
abpc Number of bits per character (aligned)
ubpc Number of bits per character (unaligned)
charSet Object representing the permitted alphabet constraint character set (optional)
virtual internal void Decode ( Asn1BerDecodeBuffer  buffer,
bool  explicitTagging,
int  implicitLength,
Asn1Tag  tag 
) [protected, virtual]

This method decodes an ASN.1 character string value including the UNIVERSAL tag value and length if explicit tagging is specified. It is a protected method that can only be accessed by objects subclassed from this type.

Parameters:
buffer Decode message buffer object
explicitTagging Flag indicating element is explicitly tagged
implicitLength Length of contents if implicit
tag Universal tag to apply

Reimplemented in Asn1AbstractTime.

void DecodeByteToChar ( Asn1OerDecodeBuffer  buffer,
int  length 
)

This method decodes a given number of bytes and converts each byte to a char having the same value.

virtual void DecodeXER ( System.String  buffer,
System.String  attrs 
) [virtual]

This method decodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML encoding rules (XER).

Parameters:
buffer String containing data to be decoded
attrs Attributes string from element tag
override void DecodeXML ( System.String  buffer,
System.String  attrs 
)

This method decodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML Schema encoding rules(asn2xsd).

Parameters:
buffer String containing data to be decoded
attrs Attributes string from element tag

Reimplemented in Asn1AbstractTime.

virtual void Encode ( Asn1JsonOutputStream  outs  )  [virtual]

Encode the value of this object as a JSON string.

Parameters:
out 
override void Encode ( Asn1XmlEncoder  buffer,
System.String  elemName,
System.String  nsPrefix 
) [virtual]

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML Encoding as specified in the XML schema standard(asn2xsd).

Parameters:
buffer Encode message buffer object
elemName XML element name used to wrap string
nsPrefix XML element namespace value

Reimplemented from Asn1Type.

Reimplemented in Asn1AbstractTime, and Asn1Real10.

override void Encode ( Asn1XerEncoder  buffer,
System.String  elemName 
) [virtual]

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. using the XML encoding rules (XER).

Parameters:
buffer Encode message buffer object
elemName XML element name used to wrap string

Reimplemented from Asn1Type.

Reimplemented in Asn1Real10.

virtual internal void Encode ( Asn1PerEncodeBuffer  buffer,
int  abpc,
int  ubpc,
Asn1CharSet  charSet,
long  lower,
long  upper 
) [protected, virtual]

This overloaded version of the encode method encodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes a size constraint is present but no permitted alphabet constraint.

The value to encode is stored in the public mValue member variable.

Parameters:
buffer Encode message buffer object
abpc Number of bits per character (aligned)
ubpc Number of bits per character (unaligned)
charSet Object representing the permitted alphabet constraint character set (optional)
lower Effective size constraint lower bound
upper Effective size constraint upper bound
virtual internal void Encode ( Asn1PerEncodeBuffer  buffer,
int  abpc,
int  ubpc,
Asn1CharSet  charSet 
) [protected, virtual]

This method encodes an ASN.1 character string value in accordance with the packed encoding rules (PER). This version of the method assumes no permitted alphabet or size constraints.

The value to encode is stored in the public mValue member variable.

Parameters:
buffer Encode message buffer object
abpc Number of bits per character (aligned)
ubpc Number of bits per character (unaligned)
charSet Object representing the permitted alphabet constraint character set (optional)
virtual internal int Encode ( Asn1BerEncodeBuffer  buffer,
bool  explicitTagging,
Asn1Tag  tag 
) [protected, virtual]

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified (the universal identifier must be provided by the caller).

Parameters:
buffer Encode message buffer object
explicitTagging Flag indicating explicit tagging should be done
tag Universal tag to apply
Returns:
Length in octets of encoded component

Reimplemented in Asn1AbstractTime.

static int Encode ( Asn1BerEncodeBuffer  buffer,
String  val,
bool  explicitTagging,
Asn1Tag  tag 
) [static, protected]

This method encodes ASN.1 8-bit character string types including IA5String, PrintableString, NumericString, etc. The UNIVERSAL tag value and length is also encoded if explicit tagging is specified (the universal identifier must be provided by the caller).

Parameters:
buffer Encode message buffer object
explicitTagging Flag indicating explicit tagging should be done
tag Universal tag to apply
Returns:
Length in octets of encoded component
override bool Equals ( System.Object  value  ) 

This method compares this character string value to the given value for equality.

Parameters:
value The Object to compare with the current Object. Object should be instance of Asn1CharString.
Returns:
true if the specified Object is equal to the current Object; otherwise, false.

Reimplemented in Asn1AbstractTime.

bool Equals ( System.String  value  ) 

This method compares this character string value to the given value for equality.

Parameters:
value The String value to compare with the current Object.
Returns:
true if the specified string is equal to the current Object; otherwise, false.
override int GetHashCode (  ) 

Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.

Returns:
A hash code for the current Object.

Reimplemented in Asn1AbstractTime.

override System.String ToString (  ) 

This method will return a string representation of the value. The format is the ASN.1 value format for this type..

Returns:
Stringified representation of the value
bool validate ( Asn1CharSet  charSet  ) 

This method will attempt to validate a string against its internal character set.

Returns:
True or False.

Member Data Documentation

internal System.Text.StringBuilder mStringBuffer [protected]

The mStringBuffer member variable is used to do internal operations on a string being encoded or decoded. Users should create it before using if it is null.

System.String mValue

The mValue public member variable is used to hold the string value to be encoded or the results of a Decode operation.


Property Documentation

override int Length [get]

Gets the length of the character string in characters.

Value: Number of characters.

Reimplemented from Asn1Type.