![]() |
Home | Libraries | People | FAQ | More |
String data types for ASN1 library.
The character string data types use predicate objects to define what is allowed to beassigned to the string type. The ASN1 speicifications list a variety of string types, (e.g. NUMERIC, IA5, PRINTABLE) that only allow for a limited character set.
The basic predicate concept is as follows:
struct predicate
{
bool operator()(const char c);
};
namespace boost { namespace asn1 { struct pred_numeric; struct pred_printable; struct pred_t61; struct pred_videotext; struct pred_ia5; struct pred_graphic; struct pred_iso646; struct pred_general; struct pred_utf8; struct pred_octet; template<typename charT, primitives_t P, typename predT> class string_t; typedef string_t< char, _numericstring, pred_numeric > numericstring_t; // String type for the NUMERIC STRING primitive String type for the PRINTABLE STRING primitive. typedef string_t< char, _printablestring, pred_printable > printablestring_t; // String type for the T61 STRING primitive. typedef string_t< char, _t61string, pred_t61 > t61string_t; // String type for the VIDEOTEXT STRING primitive. typedef string_t< char, _videotextstring, pred_videotext > videotextstring_t; // String type for the IA5 STRING primitive. typedef string_t< char, _ia5string, pred_ia5 > ia5string_t; // String type for the GRAPHIC STRING primitive. typedef string_t< char, _graphicstring, pred_graphic > graphicstring_t; // String type for the ISO646 STRING primitive. typedef string_t< char, _iso646string, pred_iso646 > iso646string_t; // String type for the GENERAL STRING primitive. typedef string_t< char, _generalstring, pred_general > generalstring_t; // String type for the UTF8 STRING primitive. typedef string_t< wchar_t, _utf8string, pred_utf8 > utf8string_t; // String type for the OCTET STRING primitive. typedef string_t< char, _octetstring, pred_octet > octetstring_t; template<typename charT, primitives_t P, typename predT> ostream & operator<<(ostream &, const string_t< charT, P, predT > &); } }namespace algorithm { }
| Copyright © 2007 Andreas Haberstroh |