Yate
Public Types | Public Member Functions | Static Public Member Functions | List of all members
AsnTag Class Reference

Class for ASN.1 tags. More...

#include <yateasn.h>

Public Types

enum  Class { Universal = 0x00 , Application = 0x40 , Context = 0x80 , Private = 0xc0 }
 
enum  Type { Primitive = 0x00 , Constructor = 0x20 }
 

Public Member Functions

 AsnTag ()
 
 AsnTag (Class clas, Type type, unsigned int code)
 
 ~AsnTag ()
 
void encode ()
 
bool operator== (const AsnTag &tag) const
 
bool operator!= (const AsnTag &tag) const
 
AsnTagoperator= (const AsnTag &value)
 
const Class classType () const
 
void classType (Class clas)
 
const Type type () const
 
void type (Type type)
 
const unsigned int code () const
 
void code (unsigned int code)
 
const DataBlockcoding () const
 

Static Public Member Functions

static void decode (AsnTag &tag, DataBlock &data)
 
static void encode (Class clas, Type type, unsigned int code, DataBlock &data)
 

Detailed Description

Class for ASN.1 tags.

Class AsnTag

Member Enumeration Documentation

◆ Class

enum Class

ASN.1 Tag class types enum

◆ Type

enum Type

ASN.1 Type of tag enum

Constructor & Destructor Documentation

◆ AsnTag() [1/2]

AsnTag ( )
inline

Constructor

◆ AsnTag() [2/2]

AsnTag ( Class  clas,
Type  type,
unsigned int  code 
)
inline

Constructor

Parameters
clasClass of the ASN.1 Tag
typeType of the ASN.1 Tag
codeCode ot the ASN.1 Tag

◆ ~AsnTag()

~AsnTag ( )
inline

Destructor

Member Function Documentation

◆ classType() [1/2]

const Class classType ( ) const
inline

Get the tag class

Returns
The class of the tag

Referenced by operator!=(), operator=(), and operator==().

◆ classType() [2/2]

void classType ( Class  clas)
inline

Set the tag class

Parameters
clasThe clas to set for the tag

◆ code() [1/2]

const unsigned int code ( ) const
inline

Get the tag code

Returns
The code of the tag

Referenced by operator!=(), operator=(), and operator==().

◆ code() [2/2]

void code ( unsigned int  code)
inline

Set the tag code

Parameters
codeThe code to set for the tag

◆ coding()

const DataBlock & coding ( ) const
inline

Get the tag encoding

Returns
The DataBlock containing the encoding for the tag

◆ decode()

static void decode ( AsnTag tag,
DataBlock data 
)
static

Decode an ASN.1 tag from the given data

Parameters
tagTag to fill
dataData from which the tag should be filled

◆ encode() [1/2]

void encode ( )
inline

Encode self

References encode().

Referenced by encode().

◆ encode() [2/2]

static void encode ( Class  clas,
Type  type,
unsigned int  code,
DataBlock data 
)
static

Encode an ASN.1 tag and put the encoded form into the given data

Parameters
clasClass of the tag
typeType of the tag
codeTag code
dataDataBlock into which to insert the encoded tag

◆ operator!=()

bool operator!= ( const AsnTag tag) const
inline

Inequality operator

References classType(), code(), and type().

◆ operator=()

AsnTag & operator= ( const AsnTag value)
inline

Assignment operator

References classType(), code(), and type().

◆ operator==()

bool operator== ( const AsnTag tag) const
inline

Equality operator

References classType(), code(), and type().

◆ type() [1/2]

const Type type ( ) const
inline

Get the tag type

Returns
The type of the tag

Referenced by operator!=(), operator=(), and operator==().

◆ type() [2/2]

void type ( Type  type)
inline

Set the tag type

Parameters
typeThe type to set for the tag

The documentation for this class was generated from the following file: