version 1.4, 2001/02/16 02:06:07
|
version 1.17, 2001/06/16 23:10:05
|
|
|
//BEGIN_LICENSE |
//%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000 The Open Group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a |
// Permission is hereby granted, free of charge, to any person obtaining a copy |
// copy of this software and associated documentation files (the "Software"), |
// of this software and associated documentation files (the "Software"), to |
// to deal in the Software without restriction, including without limitation |
// deal in the Software without restriction, including without limitation the |
// the rights to use, copy, modify, merge, publish, distribute, sublicense, |
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
// and/or sell copies of the Software, and to permit persons to whom the |
// sell copies of the Software, and to permit persons to whom the Software is |
// Software is furnished to do so, subject to the following conditions: |
// furnished to do so, subject to the following conditions: |
// | // |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN |
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED |
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT |
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR |
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
// DEALINGS IN THE SOFTWARE. |
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
// | // |
//END_LICENSE |
//============================================================================== |
//BEGIN_HISTORY |
|
// | // |
// Author: |
// Author: Mike Brasher (mbrasher@bmc.com) |
// | // |
// $Log$ |
// Modified By: |
// Revision 1.4 2001/02/16 02:06:07 mike |
|
// Renamed many classes and headers. |
|
// | // |
// Revision 1.3 2001/01/31 08:20:51 mike |
//%///////////////////////////////////////////////////////////////////////////// |
// Added dispatcher framework. |
|
// Added enumerateInstanceNames. |
|
// |
|
// Revision 1.2 2001/01/29 02:23:44 mike |
|
// Added support for GetInstance operation |
|
// |
|
// Revision 1.1.1.1 2001/01/14 19:53:36 mike |
|
// Pegasus import |
|
// |
|
// |
|
//END_HISTORY |
|
|
|
//////////////////////////////////////////////////////////////////////////////// |
|
// |
|
// XmlWriter.h |
|
// |
|
//////////////////////////////////////////////////////////////////////////////// |
|
| |
#ifndef Pegasus_XmlWriter_h | #ifndef Pegasus_XmlWriter_h |
#define Pegasus_XmlWriter_h | #define Pegasus_XmlWriter_h |
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
class ConstQualifierDecl; |
class CIMConstQualifierDecl; |
class ConstClassDecl; |
class CIMConstClass; |
|
class CIMConstInstance; |
| |
class PEGASUS_COMMON_LINKAGE XmlWriter | class PEGASUS_COMMON_LINKAGE XmlWriter |
{ | { |
|
|
const Array<Sint8>& content); | const Array<Sint8>& content); |
| |
static Array<Sint8> formatMessageElement( | static Array<Sint8> formatMessageElement( |
Uint32 messageId, |
const String& messageId, |
const Array<Sint8>& body); | const Array<Sint8>& body); |
| |
static Array<Sint8> formatSimpleReqElement( | static Array<Sint8> formatSimpleReqElement( |
|
|
const Array<Sint8>& body); | const Array<Sint8>& body); |
| |
static Array<Sint8> formatErrorElement( | static Array<Sint8> formatErrorElement( |
CimException::Code code, |
CIMException::Code code, |
const char* description); | const char* description); |
| |
static Array<Sint8>& appendBooleanParameter( | static Array<Sint8>& appendBooleanParameter( |
|
|
static Array<Sint8>& appendClassParameter( | static Array<Sint8>& appendClassParameter( |
Array<Sint8>& out, | Array<Sint8>& out, |
const char* parameterName, | const char* parameterName, |
const ConstClassDecl& classDecl); |
const CIMConstClass& cimClass); |
| |
static Array<Sint8>& appendInstanceNameParameter( | static Array<Sint8>& appendInstanceNameParameter( |
Array<Sint8>& out, | Array<Sint8>& out, |
const char* parameterName, | const char* parameterName, |
const CIMReference& instanceName); | const CIMReference& instanceName); |
| |
|
static Array<Sint8>& appendInstanceParameter( |
|
Array<Sint8>& out, |
|
const char* parameterName, |
|
const CIMConstInstance& instance); |
|
|
static Array<Sint8>& appendQualifierDeclarationParameter( | static Array<Sint8>& appendQualifierDeclarationParameter( |
Array<Sint8>& out, | Array<Sint8>& out, |
const char* parameterName, | const char* parameterName, |
const ConstQualifierDecl& qualifierDecl); |
const CIMConstQualifierDecl& qualifierDecl); |
| |
static Array<Sint8>& appendClassNameElement( | static Array<Sint8>& appendClassNameElement( |
Array<Sint8>& out, | Array<Sint8>& out, |
|
|
Array<Sint8>& out, | Array<Sint8>& out, |
const CIMReference& instanceName); | const CIMReference& instanceName); |
| |
|
static Array<Sint8>& appendPropertyNameParameter( |
|
Array<Sint8>& out, |
|
const String& propertyName); |
|
|
static void indentedPrint( | static void indentedPrint( |
std::ostream& os, |
PEGASUS_STD(ostream)& os, |
const char* text, | const char* text, |
Uint32 indentChars = 2); | Uint32 indentChars = 2); |
| |
|
|
| |
static Array<Sint8> formatSimpleRspMessage( | static Array<Sint8> formatSimpleRspMessage( |
const char* iMethodName, | const char* iMethodName, |
|
const String& messageId, |
const Array<Sint8>& body); | const Array<Sint8>& body); |
| |
static Uint32 getNextMessageId(); |
static String getNextMessageId(); |
| |
private: | private: |
| |
XmlWriter() { } | XmlWriter() { } |
}; | }; |
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, const char* x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<( |
{ |
Array<Sint8>& out, |
XmlWriter::append(out, x); |
const char* x); |
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, char x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(Array<Sint8>& out, char x); |
{ |
|
XmlWriter::append(out, x); |
|
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, Char16 x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<(Array<Sint8>& out, Char16 x); |
{ |
|
XmlWriter::append(out, x); |
|
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, const String& x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<( |
{ |
Array<Sint8>& out, |
XmlWriter::append(out, x); |
const String& x); |
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, const Indentor& x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<( |
{ |
Array<Sint8>& out, |
XmlWriter::append(out, x); |
const Indentor& x); |
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, const Array<Sint8>& x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<( |
{ |
Array<Sint8>& out, |
out.appendArray(x); |
const Array<Sint8>& x); |
return out; |
|
} |
|
| |
inline Array<Sint8>& operator<<(Array<Sint8>& out, Uint32 x) |
PEGASUS_COMMON_LINKAGE Array<Sint8>& operator<<( |
{ |
Array<Sint8>& out, |
XmlWriter::append(out, x); |
Uint32 x); |
return out; |
|
} |
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |