Portability Libraries  2015.2.0.0
Common Methods and Objects for Platform Independance.
XMLNumberForm.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2015 Software And Services LLC, All Rights Reserved
3 //
4 // THIS SOURCE CODE BELONGS TO SOFTWARE AND SERVICES LLC. THIS CODE
5 // IS PROPERTY OF THE COPYRIGHT HOLDER AND IS NOT TO BE DIVULGED OR
6 // USED BY PARTIES WHO HAVE NOT RECEIVED WRITTEN AUTHORIZATION FROM
7 // THE OWNER.
8 //
9 // THIS SOFTWARE AND MANUAL ARE BOTH PROTECTED BY UNITED STATES
10 // COPYRIGHT LAW (TITLE 17 UNITED STATES CODE). UNAUTHORIZED
11 // REPRODUCTION AND/OR SALE MAY RESULT IN IMPRISONMENT OF UP TO FIVE
12 // YEARS AND FINES OF UP TO $250,000 (17 USC 506). COPYRIGHT
13 // INFRINGERS MAY ALSO BE SUBJECT TO CIVIL LIABILITY.
14 //
15 // THIS NOTICE AND THE ABOVE COPYRIGHT NOTICE MUST REMAIN IN ALL
16 // COPIES AND ANY DERIVED WORK.
17 //
18 // ALL OF THIS CODE IS ORIGINAL WORK BY THE COPYRIGHT HOLDER.
19 //
20 // THIS DOCUMENT AND THE INFORMATION CONTAINED HEREIN IS
21 // PROVIDED ON AN "AS IS" BASIS AND SOFTWARE AND SERVICES LLC
22 // DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT
23 // LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN
24 // WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES
25 // OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
26 //
27 // THIS SOURCE CODE IS UNPUBLISHED WORK FULLY PROTECTED BY THE
28 // UNITED STATES COPYRIGHT LAWS AND IS CONSIDERED A TRADE SECRET
29 // BELONGING TO THE COPYRIGHT HOLDER.
30 //
31 #ifndef _DOUGLAS_MARK_ROYER_SAS_LIBRARY_ASN1_XMLNumberForm_HPP_
32 #define _DOUGLAS_MARK_ROYER_SAS_LIBRARY_ASN1_XMLNumberForm_HPP_
33 
34 #include <SaS/Common/String.hpp>
35 #include <SaS/Common/File.hpp>
36 
38 
39 #ifdef BUILDING_LIBRARY_ASN1
40 #include "Asn1.hpp"
41 #include "number.hpp"
42 #else
43 #include <SaS/Asn1/Asn1.hpp>
44 #include <SaS/Asn1/number.hpp>
45 #endif
46 
47 namespace SoftwareAndServices
48 {
49  namespace Library
50  {
51  namespace Asn1
52  {
53 
54  /**
55  * CLASS: XMLNumberForm
56  *
57  */
59  : public Asn1Object,
60  public AsnType<number>
61  {
62 
63  public:
64 
65  /**
66  * XMLNumberForm - Default Constructor
67  *
68  * @param Parent The parent Asn1Object object.
69  */
70  XMLNumberForm(Asn1Object & Parent);
71 
72  /**
73  * XMLNumberForm - Destructor
74  */
75  virtual ~XMLNumberForm();
76 
77  /**
78  * Parse ASN.1 file object.
79  *
80  * @param Optional When true, the object is optional.
81  *
82  * @return true if successfully parse.
83  * Also return true if Optional is true and the object
84  * does not exist in the input stream.
85  */
86  virtual bool ParseAsn1(bool Optional = false);
87 
88  /**
89  * Parse DER file object.
90  *
91  * @param DerDef The ASN.1 DER file that defines
92  * what to read.
93  *
94  * @return true if successfully parse.
95  */
96  virtual bool ParseDer(Asn1Object & DerDef);
97 
98  /**
99  * Print this object as an BISON/FLEX parser that
100  * can perform IO to the ASN.1 object defined
101  * and parsed.
102  *
103  * @param Fp The File object to print to.
104  *
105  * @param NamePrefix The file name. Two files
106  * will be created: A bison file suffixed with ".y" and a
107  * FLEX file suffixed with ".l".
108  *
109  * @return true if successfully printed.
110  */
111  virtual bool PrintBison(File & Fp,
112  String & NamePrefix) const;
113 
114  /**
115  * Print this object as an ASN.1 text file.
116  *
117  * @param Fp The File object to print to.
118  *
119  * @return true if successfully printed.
120  */
121  virtual bool PrintAsn1(File & Fp) const;
122 
123  /**
124  * Print this object as an RPCGEN input file.
125  * And any XDR methods needed.
126  *
127  * @param Fp The File object to print to.
128  *
129  * @param NamePrefix The file name. Three files
130  * will be created: An RPCGEN file suffixed with ".x", a
131  * C++ file suffixed with ".cpp" that will contain
132  * any needed XDR methods, and a C++ header file suffixed
133  * with ".hpp".
134  *
135  * @return true if successfully printed.
136  */
137  virtual bool PrintRpcGen(File & Fp) const;
138 
139  /**
140  * Print this object as an C++ parse that
141  * can perform IO to the ASN.1 object defined
142  * and parsed.
143  *
144  * @param Fp The File object to print to.
145  *
146  * @param NamePrefix The file name. Two files
147  * will be created: A C++ file suffixed with ".cpp" and a
148  * C++ header file suffixed with ".hpp".
149  *
150  * @return true if successfully printed.
151  */
152  virtual bool PrintCpp(File & Fp,
153  String & NamePrefix) const;
154 
155  /**
156  * Print this object as a DER file.
157  *
158  * @param Fp The File object to print to.
159  *
160  * @return true if successfully printed.
161  */
162  virtual bool PrintDer(File & Fp) const;
163 
164  /**
165  * Determine if the object is complete.
166  *
167  * @param Recursive When true, call ObjectIsComplete()
168  * on included objects.
169  *
170  * @return true when the object seems to have all
171  * of its required values and the correct number of
172  * optional values.
173  */
174  virtual bool ObjectIsComplete(bool Recursive = false) const;
175 
176  private:
177 
178  };
179 
180  }
181  }
182 }
183 
184 #endif //_DOUGLAS_MARK_ROYER_SAS_LIBRARY_ASN1_XMLNumberForm_HPP_