Branch: Tag:

2014-06-09

2014-06-09 14:14:02 by Martin Nilsson <nilsson@opera.com>

Simplify the code a bit by not having cls and tag as constants.

48:   //! Generic, abstract base class for ASN1 data types.   class Object   { -  constant cls = 0; -  constant tag = 0; +  int cls = 0; +  int tag = 0;    constant constructed = 0;       constant type_name = "";
293:   class Boolean   {    inherit Object; -  constant tag = 1; +  int tag = 1;    constant type_name = "BOOLEAN";       //! value of object
335:   class Integer   {    inherit Object; -  constant tag = 2; +  int tag = 2;    constant type_name = "INTEGER";       //! value of object
396:   class Enumerated   {    inherit Integer; -  constant tag = 10; +  int tag = 10;    constant type_name ="ENUMERATED";   }   
404:   class BitString   {    inherit Object; -  constant tag = 3; +  int tag = 3;    constant type_name = "BIT STRING";       //! value of object
488:   class OctetString   {    inherit String; -  constant tag = 4; +  int tag = 4;    constant type_name = "OCTET STRING";   }   
496:   class Null   {    inherit Object; -  constant tag = 5; +  int tag = 5;    constant type_name = "NULL";       string(0..255) get_der_content() { return ""; }
519:   class Identifier   {    inherit Object; -  constant tag = 6; +  int tag = 6;    constant type_name = "OBJECT IDENTIFIER";       //! value of object
623:   class UTF8String   {    inherit String; -  constant tag = 12; +  int tag = 12;    constant type_name = "UTF8String";       string(0..255) get_der_content()
650:   class Sequence   {    inherit Compound; -  constant tag = 16; +  int tag = 16;    constant type_name = "SEQUENCE";       string(0..255) get_der_content()
680:   class Set   {    inherit Compound; -  constant tag = 17; +  int tag = 17;    constant type_name = "SET";       int(-1..1) compare_octet_strings(string r, string s)
721:   class PrintableString   {    inherit String; -  constant tag = 19; +  int tag = 19;    constant type_name = "PrintableString";   }   
773:   class TeletexString   {    inherit String; -  constant tag = 20; +  int tag = 20;    constant type_name = "TeletexString"; // Alias: T61String      #define ENC_ERR(char) char
1153:   class BrokenTeletexString   {    inherit String; -  constant tag = 20; +  int tag = 20;    constant type_name = "TeletexString"; // Alias: T61String   }   
1173:   class IA5String   {    inherit String; -  constant tag = 22; +  int tag = 22;    constant type_name = "IA5STRING";   }      //!   class VisibleString {    inherit String; -  constant tag = 26; +  int tag = 26;    constant type_name = "VisibleString";   }   
1190:   class UTC   {    inherit String; -  constant tag = 23; +  int tag = 23;    constant type_name = "UTCTime";       //!
1250:   class UniversalString   {    inherit OctetString; -  constant tag = 28; +  int tag = 28;    constant type_name = "UniversalString";       string get_der_content() {
1281:   class BMPString   {    inherit OctetString; -  constant tag = 30; +  int tag = 30;    constant type_name = "BMPString";       string get_der_content() {