version 1.82.2.1, 2008/02/06 00:08:50
|
version 1.87, 2008/10/17 07:16:35
|
|
|
#include <Pegasus/Common/InternalException.h> | #include <Pegasus/Common/InternalException.h> |
#include <Pegasus/Common/ArrayInternal.h> | #include <Pegasus/Common/ArrayInternal.h> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
#include <Pegasus/Common/Indentor.h> |
|
#include <Pegasus/Common/CIMObject.h> | #include <Pegasus/Common/CIMObject.h> |
#include <Pegasus/Common/CIMClass.h> | #include <Pegasus/Common/CIMClass.h> |
#include <Pegasus/Common/CIMInstance.h> | #include <Pegasus/Common/CIMInstance.h> |
|
|
#include <Pegasus/Common/AcceptLanguageList.h> | #include <Pegasus/Common/AcceptLanguageList.h> |
#include <Pegasus/Common/Buffer.h> | #include <Pegasus/Common/Buffer.h> |
#include <Pegasus/Common/StrLit.h> | #include <Pegasus/Common/StrLit.h> |
|
#include <Pegasus/Common/XmlGenerator.h> |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
// l10n - added accept language and content language support below |
class PEGASUS_COMMON_LINKAGE XmlWriter : public XmlGenerator |
|
|
class PEGASUS_COMMON_LINKAGE XmlWriter |
|
{ | { |
public: | public: |
| |
static void append(Buffer& out, const Char16& x); |
|
|
|
static void append(Buffer& out, char x) |
|
{ |
|
out.append(x); |
|
} |
|
|
|
static void append(Buffer& out, Boolean x); |
|
|
|
static void append(Buffer& out, Uint32 x); |
|
|
|
static void append(Buffer& out, Sint32 x); |
|
|
|
static void append(Buffer& out, Uint64 x); |
|
|
|
static void append(Buffer& out, Sint64 x); |
|
|
|
static void append(Buffer& out, Real32 x); |
|
|
|
static void append(Buffer& out, Real64 x); |
|
|
|
static void append(Buffer& out, const char* str); |
|
|
|
static void append(Buffer& out, const String& str); |
|
|
|
static void append(Buffer& out, const Indentor& x); |
|
|
|
static void appendSpecial(Buffer& out, const Char16& x); |
|
|
|
static void appendSpecial(Buffer& out, char x); |
|
|
|
static void appendSpecial(Buffer& out, const char* str); |
|
|
|
static void appendSpecial(Buffer& out, const String& str); |
|
|
|
static String encodeURICharacters(const Buffer& uriString); |
|
static String encodeURICharacters(const String& uriString); |
|
|
|
static void appendLocalNameSpacePathElement( | static void appendLocalNameSpacePathElement( |
Buffer& out, | Buffer& out, |
const CIMNamespaceName& nameSpace); | const CIMNamespaceName& nameSpace); |
|
|
const ContentLanguageList& contentLanguages, | const ContentLanguageList& contentLanguages, |
Uint32 contentLength); | Uint32 contentLength); |
| |
// added to accommodate sending WBEMServerResponseTime PEP #128 |
|
static void appendMethodResponseHeader( | static void appendMethodResponseHeader( |
Buffer& out, | Buffer& out, |
HttpMethod httpMethod, | HttpMethod httpMethod, |
|
|
Buffer& out, | Buffer& out, |
const String& content); | const String& content); |
#endif | #endif |
|
|
static void appendParamTypeAndEmbeddedObjAttrib( | static void appendParamTypeAndEmbeddedObjAttrib( |
Buffer& out, | Buffer& out, |
const CIMType& type); | const CIMType& type); |
|
|
const AcceptLanguageList& httpAcceptLanguages, | const AcceptLanguageList& httpAcceptLanguages, |
const ContentLanguageList& httpContentLanguages); | const ContentLanguageList& httpContentLanguages); |
| |
// PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in |
|
// response header |
|
static Buffer formatSimpleMethodRspMessage( | static Buffer formatSimpleMethodRspMessage( |
const CIMName& methodName, | const CIMName& methodName, |
const String& messageId, | const String& messageId, |
|
|
const ContentLanguageList& httpContentLanguages, | const ContentLanguageList& httpContentLanguages, |
const Buffer& body); | const Buffer& body); |
| |
// PEP 128 - sending serverResponseTime (WBEMServerResponseTime) in |
|
// response header |
|
static Buffer formatSimpleIMethodRspMessage( | static Buffer formatSimpleIMethodRspMessage( |
const CIMName& iMethodName, | const CIMName& iMethodName, |
const String& messageId, | const String& messageId, |
|
|
HttpMethod httpMethod, | HttpMethod httpMethod, |
const CIMException& cimException); | const CIMException& cimException); |
| |
static void indentedPrint( |
|
PEGASUS_STD(ostream)& os, |
|
const char* text, |
|
Uint32 indentChars = 2); |
|
|
|
static String getNextMessageId(); | static String getNextMessageId(); |
| |
/** Converts the given CIMKeyBinding type to one of the following: | /** Converts the given CIMKeyBinding type to one of the following: |
"boolean", "string", or "numeric" | "boolean", "string", or "numeric" |
*/ | */ |
static const char* keyBindingTypeToString (CIMKeyBinding::Type type); |
static const StrLit keyBindingTypeToString (CIMKeyBinding::Type type); |
| |
private: | private: |
| |
|
|
static void _appendEMethodResponseElementEnd( | static void _appendEMethodResponseElementEnd( |
Buffer& out); | Buffer& out); |
| |
XmlWriter() { } |
XmlWriter(); |
}; | }; |
| |
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
const char* x); |
|
|
|
inline Buffer& operator<<(Buffer& out, char x) |
|
{ |
|
out.append(x); |
|
return out; |
|
} |
|
|
|
inline Buffer& operator<<(Buffer& out, const char* s) |
|
{ |
|
out.append(s, (Uint32)strlen(s)); |
|
return out; |
|
} |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<(Buffer& out, const Char16& x); |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
const String& x); |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
const Indentor& x); |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
const Buffer& x); |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
Uint32 x); |
|
|
|
PEGASUS_COMMON_LINKAGE Buffer& operator<<( |
|
Buffer& out, |
|
const CIMName& name); |
|
|
|
PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<( |
|
PEGASUS_STD(ostream)& os, |
|
const CIMDateTime& x); |
|
|
|
PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<( |
|
PEGASUS_STD(ostream)& os, |
|
const CIMName& name); |
|
|
|
PEGASUS_COMMON_LINKAGE PEGASUS_STD(ostream)& operator<<( |
|
PEGASUS_STD(ostream)& os, |
|
const CIMNamespaceName& name); |
|
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
| |