]> git.saurik.com Git - apple/security.git/blob - SecuritySNACCRuntime/c++-lib/inc/asn-enum.h
a5f91b2e3170dfc1beb0f040eaa7f540acc457c7
[apple/security.git] / SecuritySNACCRuntime / c++-lib / inc / asn-enum.h
1 /*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19 // file: .../c++-lib/inc/asn-enum.h - c++ version of ASN.1 ENUMERATED
20 //
21 // inherits from AsnInt but changes universal tag stuff
22 // MS 92/06/15
23 //
24 // Copyright (C) 1992 Michael Sample and the University of British Columbia
25 //
26 // This library is free software; you can redistribute it and/or
27 // modify it provided that this copyright/license information is retained
28 // in original form.
29 //
30 // If you modify this file, you must clearly indicate your changes.
31 //
32 // This source code is distributed in the hope that it will be
33 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
34 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
35 //
36 // $Header: /cvs/Darwin/Security/SecuritySNACCRuntime/c++-lib/inc/asn-enum.h,v 1.1.1.1 2001/05/18 23:14:06 mb Exp $
37 // $Log: asn-enum.h,v $
38 // Revision 1.1.1.1 2001/05/18 23:14:06 mb
39 // Move from private repository to open source repository
40 //
41 // Revision 1.3 2001/05/05 00:59:18 rmurphy
42 // Adding darwin license headers
43 //
44 // Revision 1.2 2000/06/15 18:48:23 dmitch
45 // Snacc-generated source files, now part of CVS tree to allow for cross-platform build of snaccRuntime.
46 //
47 // Revision 1.1.1.1 2000/03/09 01:00:05 rmurphy
48 // Base Fortissimo Tree
49 //
50 // Revision 1.2 1999/03/21 02:07:32 mb
51 // Added Copy to every AsnType.
52 //
53 // Revision 1.1 1999/02/25 05:21:42 mb
54 // Added snacc c++ library
55 //
56 // Revision 1.5 1995/08/17 15:17:07 rj
57 // AsnEnumTypeDesc gets its own TclGetVal and TclSetVal functions.
58 //
59 // Revision 1.4 1995/07/24 17:52:00 rj
60 // Clone() added, or else the _desc would be wrong (and the wrong BEnc etc... would get called for Clone-d objects).
61 //
62 // _desc changed from AsnIntTypeDesc to AsnEnumTypeDesc.
63 //
64 // changed `_' to `-' in file names.
65 //
66 // Revision 1.3 1994/10/08 04:17:59 rj
67 // code for meta structures added (provides information about the generated code itself).
68 //
69 // code for Tcl interface added (makes use of the above mentioned meta code).
70 //
71 // virtual inline functions (the destructor, the Clone() function, BEnc(), BDec() and Print()) moved from inc/*.h to src/*.C because g++ turns every one of them into a static non-inline function in every file where the .h file gets included.
72 //
73 // made Print() const (and some other, mainly comparison functions).
74 //
75 // several `unsigned long int' turned into `size_t'.
76 //
77 // Revision 1.2 1994/08/28 10:00:48 rj
78 // comment leader fixed.
79 //
80 // Revision 1.1 1994/08/28 09:20:31 rj
81 // first check-in. for a list of changes to the snacc-1.1 distribution please refer to the ChangeLog.
82
83 #ifndef _asn_enum_h_
84 #define _asn_enum_h_
85
86 class AsnEnum: public AsnInt
87 {
88 public:
89 #if !TCL
90 AsnEnum():
91 AsnInt()
92 {}
93 #endif
94 AsnEnum (int i):
95 AsnInt (i)
96 {}
97
98 virtual AsnType *Clone() const;
99 virtual AsnType *Copy() const;
100
101 AsnLen BEnc (BUF_TYPE b);
102 void BDec (BUF_TYPE b, AsnLen &bytesDecoded, ENV_TYPE env);
103
104 PDU_MEMBER_MACROS
105
106 #if META
107 static const AsnEnumTypeDesc _desc;
108
109 const AsnTypeDesc *_getdesc() const;
110
111 #if TCL
112 int TclGetVal (Tcl_Interp *) const;
113 int TclSetVal (Tcl_Interp *, const char *val);
114 #endif /* TCL */
115 #endif /* META */
116 };
117
118 #endif /* conditional include */