(file) Return to XmlReader.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 mike  1.13 //%/////////////////////////////////////////////////////////////////////////////
  2            //
  3            // Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM
  4            //
  5            // Permission is hereby granted, free of charge, to any person obtaining a copy
  6            // of this software and associated documentation files (the "Software"), to 
  7            // deal in the Software without restriction, including without limitation the 
  8            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 
  9            // sell copies of the Software, and to permit persons to whom the Software is
 10            // furnished to do so, subject to the following conditions:
 11            // 
 12            // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN 
 13            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 14            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 15            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
 16            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
 17            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 
 18            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 19            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 20            //
 21            //==============================================================================
 22 mike  1.13 //
 23            // Author: Mike Brasher (mbrasher@bmc.com)
 24            //
 25            // Modified By:
 26            //
 27            //%/////////////////////////////////////////////////////////////////////////////
 28            
 29            #ifndef Pegasus_XmlReader_h
 30            #define Pegasus_XmlReader_h
 31            
 32            #include <Pegasus/Common/Config.h>
 33            #include <Pegasus/Common/XmlParser.h>
 34            #include <Pegasus/Common/CIMFlavor.h>
 35            #include <Pegasus/Common/CIMScope.h>
 36            #include <Pegasus/Common/CIMReference.h>
 37            
 38            PEGASUS_NAMESPACE_BEGIN
 39            
 40            class CIMQualifier;
 41            class CIMQualifierDecl;
 42            class CIMClass;
 43 mike  1.13 class CIMInstance;
 44            class CIMProperty;
 45            class CIMParameter;
 46            class CIMMethod;
 47            
 48            class PEGASUS_COMMON_LINKAGE XmlReader
 49            {
 50            public:
 51            
 52                static void expectXmlDeclaration(
 53            	XmlParser& parser, 
 54            	XmlEntry& entry);
 55            
 56                static void expectStartTag(
 57            	XmlParser& parser, 
 58            	XmlEntry& entry,
 59            	const char* tagName);
 60            
 61                static void expectEndTag(
 62            	XmlParser& parser, 
 63            	const char* tagName);
 64 mike  1.13 
 65                static void expectStartTagOrEmptyTag(
 66            	XmlParser& parser, 
 67            	XmlEntry& entry,
 68            	const char* tagName);
 69            
 70                static Boolean expectContentOrCData(
 71            	XmlParser& parser, 
 72            	XmlEntry& entry);
 73            
 74                static Boolean testStartTag(
 75            	XmlParser& parser, 
 76            	XmlEntry& entry,
 77            	const char* tagName);
 78            
 79                static Boolean testEndTag(
 80            	XmlParser& parser, 
 81            	const char* tagName);
 82            
 83                static Boolean testStartTagOrEmptyTag(
 84            	XmlParser& parser, 
 85 mike  1.13 	XmlEntry& entry,
 86            	const char* tagName);
 87            
 88                static Boolean testContentOrCData(
 89            	XmlParser& parser, 
 90            	XmlEntry& entry);
 91            
 92                static void testCimStartTag(XmlParser& parser);
 93            
 94                static Boolean getIsArrayAttribute(
 95            	Uint32 lineNumber,
 96            	const XmlEntry& entry,
 97            	const char* tagName,
 98            	Boolean& value);
 99            
100                static String getCimNameAttribute(
101            	Uint32 lineNumber, 
102            	const XmlEntry& entry,
103            	const char* elementName,
104            	Boolean acceptNull = false);
105            
106 mike  1.13     static String getClassNameAttribute(
107            	Uint32 lineNumber, 
108            	const XmlEntry& entry,
109            	const char* elementName);
110            
111                static String getClassOriginAttribute(
112            	Uint32 lineNumber, 
113            	const XmlEntry& entry,
114            	const char* tagName);
115            
116                static String getReferenceClassAttribute(
117            	Uint32 lineNumber, 
118            	const XmlEntry& entry,
119            	const char* elementName);
120            
121                static String getSuperClassAttribute(
122            	Uint32 lineNumber, 
123            	const XmlEntry& entry,
124            	const char* tagName);
125            
126                static CIMType getCimTypeAttribute(
127 mike  1.13 	Uint32 lineNumber, 
128            	const XmlEntry& entry, 
129            	const char* tagName);
130            
131                static Boolean getCimBooleanAttribute(
132            	Uint32 lineNumber,
133            	const XmlEntry& entry,
134            	const char* tagName,
135            	const char* attributeName,
136            	Boolean defaultValue,
137            	Boolean required);
138            
139                static Boolean stringToReal(
140            	const char* stringValue, 
141            	Real64& x);
142            
143                static Boolean stringToSignedInteger(
144            	const char* stringValue, 
145            	Sint64& x);
146            
147                static Boolean stringToUnsignedInteger(
148 mike  1.13 	const char* stringValue, 
149            	Uint64& x);
150            
151                static CIMValue stringToValue(
152            	Uint32 lineNumber, 
153            	const char* valueString, 
154            	CIMType type);
155            
156                static Boolean getValueElement(
157            	XmlParser& parser, 
158            	CIMType type, 
159            	CIMValue& value);
160            
161                static CIMValue stringArrayToValue(
162            	Uint32 lineNumber, 
163            	const Array<const char*>& array, 
164            	CIMType type);
165            
166                static Boolean getValueArrayElement(
167            	XmlParser& parser, 
168            	CIMType type, 
169 mike  1.13 	CIMValue& value);
170            
171                static Uint32 getFlavor(
172            	XmlEntry& entry, 
173            	Uint32 lineNumber, 
174            	const char* tagName);
175            
176                static Uint32 getOptionalScope(
177            	XmlParser& parser);
178            
179                static Boolean getQualifierElement(
180            	XmlParser& parser, 
181            	CIMQualifier& qualifier);
182            
183                static Boolean getPropertyElement(
184            	XmlParser& parser, 
185            	CIMProperty& property);
186            
187                static Boolean getArraySizeAttribute(
188            	Uint32 lineNumber,
189            	const XmlEntry& entry,
190 mike  1.13 	const char* tagName,
191            	Uint32& value);
192            
193                static Boolean getPropertyArrayElement(
194            	XmlParser& parser, 
195            	CIMProperty& property);
196            
197                static Boolean getHostElement(
198            	XmlParser& parser,
199            	String& host);
200            
201                static Boolean getNameSpaceElement(
202            	XmlParser& parser,
203            	String& nameSpaceComponent);
204            
205                static Boolean getLocalNameSpacePathElement(
206            	XmlParser& parser,
207            	String& nameSpace);
208            
209                static Boolean getNameSpacePathElement(
210            	XmlParser& parser,
211 mike  1.13 	String& host,
212            	String& nameSpace);
213            
214                static Boolean getClassNameElement(
215            	XmlParser& parser,
216            	String& className,
217            	Boolean required = false);
218            
219                static KeyBinding::Type getValueTypeAttribute(
220            	Uint32 lineNumber, 
221            	const XmlEntry& entry,
222            	const char* elementName);
223            
224                static Boolean getKeyValueElement(
225            	XmlParser& parser,
226            	KeyBinding::Type& type,
227            	String& value);
228            
229                static Boolean getKeyBindingElement(
230            	XmlParser& parser,
231            	String& name,
232 mike  1.13 	String& value,
233            	KeyBinding::Type& type);
234            
235                static Boolean getInstanceNameElement(
236            	XmlParser& parser,
237            	String& className,
238            	Array<KeyBinding>& keyBindings);
239            
240                static Boolean getInstancePathElement(
241            	XmlParser& parser,
242            	CIMReference& reference);
243            
244                static Boolean getLocalInstancePathElement(
245            	XmlParser& parser,
246            	CIMReference& reference);
247            
248                static Boolean getClassPathElement(
249            	XmlParser& parser,
250            	CIMReference& reference);
251            
252                static Boolean getLocalClassPathElement(
253 mike  1.13 	XmlParser& parser,
254            	CIMReference& reference);
255            
256                static Boolean getValueReferenceElement(
257            	XmlParser& parser,
258            	CIMReference& reference);
259            
260                static Boolean getPropertyReferenceElement(
261            	XmlParser& parser, 
262            	CIMProperty& property);
263            
264                static Boolean getParameterElement(
265            	XmlParser& parser, 
266            	CIMParameter& parameter);
267            
268                static Boolean getParameterArrayElement(
269            	XmlParser& parser, 
270            	CIMParameter& parameter);
271            
272                static Boolean getParameterReferenceElement(
273            	XmlParser& parser, 
274 mike  1.13 	CIMParameter& parameter);
275            
276                static Boolean getQualifierDeclElement(
277            	XmlParser& parser, 
278            	CIMQualifierDecl& qualifierDecl);
279            
280                static Boolean getMethodElement(
281            	XmlParser& parser, 
282            	CIMMethod& method);
283            
284                static Boolean getClassElement(
285            	XmlParser& parser, 
286            	CIMClass& cimClass);
287            
288                static Boolean getInstanceElement(
289            	XmlParser& parser, 
290            	CIMInstance& cimInstance);
291            
292                static void getObject(XmlParser& parser, CIMClass& x);
293            
294                static void getObject(XmlParser& parser, CIMInstance& x);
295 mike  1.13 
296                static void getObject(XmlParser& parser, CIMQualifierDecl& x);
297            
298                static Boolean getMessageStartTag(
299            	XmlParser& parser, 
300            	String& id,
301            	const char*& protocolVersion);
302            
303                static Boolean getIMethodCallStartTag(
304            	XmlParser& parser, 
305            	const char*& name);
306            
307                static Boolean getIMethodResponseStartTag(
308            	XmlParser& parser, 
309            	const char*& name);
310            
311                static Boolean getIParamValueTag(
312            	XmlParser& parser, 
313            	const char*& name);
314            
315                static Boolean getPropertyValue(
316 mike  1.13 	XmlParser& parser, 
317            	CIMValue& cimValue);
318            
319                static Boolean getBooleanValueElement(
320            	XmlParser& parser, 
321            	Boolean& result,
322            	Boolean required = false);
323            
324                static Boolean getErrorElement(
325            	XmlParser& parser, 
326            	CIMException::Code& code,
327            	const char*& description,
328            	Boolean required = false);
329            
330            private:
331            
332                XmlReader() 
333                { 
334            
335                }
336            };
337 mike  1.13 
338            PEGASUS_NAMESPACE_END
339            
340            #endif /* Pegasus_XmlReader_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2