Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
p6domxml.h
Go to the documentation of this file.
1 
13 #ifndef P6DOMXML_H__
14 #define P6DOMXML_H__ 1
15 
16 #include "p6err.h"
17 #include "p6datastream.h"
18 #include "p6domxmltypes.h"
19 #include "p6domnodeset.h"
20 #include "p6sax2xmlreader.h"
21 #include "p6jsonreader.h"
22 #include "p6iobuffer.h"
23 
24 namespace P6R {
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
50 typedef struct
51 {
52  P6R::P6XPATH_TYPE type; // which type is used?
53  const P6R::P6WCHAR* pString; //
54  P6R::P6UINT32 strLength; // length of the string pString
65 
66 
82 const P6DOMOUTPUT P6DOMOUTPUT_XML = 0x00000001;
83 const P6DOMOUTPUT P6DOMOUTPUT_JSON = 0x00000002;
84 const P6DOMOUTPUT P6DOMOUTPUT_CHARSETUTF8 = 0x00000004;
85 const P6DOMOUTPUT P6DOMOUTPUT_JSONML = 0x00000008;
86 const P6DOMOUTPUT P6DOMOUTPUT_KMIPXML = 0x00000010;
87 const P6DOMOUTPUT P6DOMOUTPUT_KMIPJSON = 0x00000020;
88 const P6DOMOUTPUT P6DOMOUTPUT_KMIPJSON_SOLIDUS_ESCAPE = 0x00000040;
89 
90 
99 interface p6IDOMXML : public p6ICom
100 {
116  P6COMMETHOD initialize( P6DOMXMLFLAGS flags, p6IDataStream* pErrorResult ) = 0;
117 
138  P6COMMETHOD setSAXParser( p6ISAX2XMLReader* pReader ) = 0;
139 
156  P6COMMETHOD setJSONParser( p6IJSONReader* pReader ) = 0;
157 
173  P6COMMETHOD parse( p6IDataStream** pInData ) = 0;
174 
187  P6COMMETHOD parseMessage( p6IIoBuffer* pMsg ) = 0;
188 
203  P6COMMETHOD getRootNode( p6IXMLNode** pNode ) = 0;
204 
224  P6COMMETHOD moveSubTree( p6IXMLNode* pParent, p6IXMLNode* pMoveNode ) = 0;
225 
240  p6IDOMNodeset** pSet
241  ) = 0;
242 
262  P6COMMETHOD isParentOf( const P6WCHAR* pName,
263  P6UINT32 nameLength,
264  const P6WCHAR* pURI,
265  P6UINT32 uriLength,
266  p6IXMLNode* pNode,
267  p6IXMLNode** pFoundAncestor
268  ) = 0;
269 
294  P6COMMETHOD isAncestorOf( const P6WCHAR* pName,
295  P6UINT32 nameLength,
296  const P6WCHAR* pURI,
297  P6UINT32 uriLength,
298  p6IXMLNode* pNode,
299  p6IXMLNode** pFoundAncestor
300  ) = 0;
301 
322  P6COMMETHOD stripSpace( P6WCHAR* pElementName,
323  P6UINT32 elemLength,
324  P6WCHAR* pNamespaceURI,
325  P6UINT32 uriLength
326  ) = 0;
327 
350  P6COMMETHOD preserveSpace( P6WCHAR* pElementName,
351  P6UINT32 elemLength,
352  P6WCHAR* pNamespaceURI,
353  P6UINT32 uriLength
354  ) = 0;
355 
367 
377 
391  P6COMMETHOD output( p6IDataStream* pStream, P6DOMOUTPUT flags ) = 0;
392 
409  P6COMMETHOD replaceChildAt( p6IXMLNode* pParent, P6UINT32 index, p6IXMLNode* pNewChild ) = 0;
410 };
411 
412 // {774F828D-44CE-4e62-86BB-71F939605AFE}
413 #define IF_p6IDOMXML {0x774f828d,0x44ce,0x4e62,{0x86,0xbb,0x71,0xf9,0x39,0x60,0x5a,0xfe}}
414 
415 // {15BBA122-8B01-404b-BC4D-2E7E129437A6}
416 #define COMP_p6DOMXML {0x15bba122,0x8b01,0x404b,{0xbc,0x4d,0x2e,0x7e,0x12,0x94,0x37,0xa6}}
417 
418 #ifdef __cplusplus
419 }
420 #endif
421 
422 } // namespace
423 
424 
425 #endif
426 
427 
428 
429 
430 
431 
virtual P6R::P6ERR stripSpace(P6WCHAR *pElementName, P6UINT32 elemLength, P6WCHAR *pNamespaceURI, P6UINT32 uriLength)=0
This method allows the application to define which XML elements should have unnecessary white space s...
P6R::P6INT64 lResult
Definition: p6domxml.h:62
const P6R::P6WCHAR * pString
Definition: p6domxml.h:53
P6LONGLONG P6INT64
Definition: p6types.h:50
const P6DOMOUTPUT P6DOMOUTPUT_CHARSETUTF8
Definition: p6domxml.h:84
P6R::p6IXpathTime * ptResult
Definition: p6domxml.h:61
unsigned int P6UINT32
Definition: p6types.h:40
virtual P6R::P6ERR replaceChildAt(p6IXMLNode *pParent, P6UINT32 index, p6IXMLNode *pNewChild)=0
Replace the nth child of the parent node with the new child node.
P6R's interface of the DOM parser.
Definition: p6domxml.h:99
virtual P6R::P6ERR isParentOf(const P6WCHAR *pName, P6UINT32 nameLength, const P6WCHAR *pURI, P6UINT32 uriLength, p6IXMLNode *pNode, p6IXMLNode **pFoundAncestor)=0
Is there an XML node with pName that is the immediate parent of the pNode XML node.
I/O Buffer Interfaces.
This is the main SAX interface.
Standard error codes.
P6R's C++ Interface of the SAX 2 XML Reader.
The return value form an XPath 2.0 expression evaluation.
Definition: p6domxml.h:50
bool P6BOOL
Boolean type.
Definition: p6types.h:101
Types shared between all XML components.
virtual P6R::P6ERR createNodeSet(p6IXMLNode *pNode, p6IDOMNodeset **pSet)=0
Given a single p6IXNLNode create and return a p6IDOMNodeset.
P6R::p6IDOMNodeset * pNodeSet
Definition: p6domxml.h:63
P6R::P6INT32 iResult
Definition: p6domxml.h:58
virtual P6R::P6ERR initialize(P6DOMXMLFLAGS flags, p6IDataStream *pErrorResult)=0
Sets up the component to run properly.
This interface is an implementation of the following XPath 2.0 time types: xs:date, xs:dateTime, xs:time.
Definition: p6xpathtime.h:27
P6R::P6XPATH_TYPE type
Definition: p6domxml.h:52
p6IDataStream interface definitions
virtual P6R::P6ERR moveSubTree(p6IXMLNode *pParent, p6IXMLNode *pMoveNode)=0
Move a subtree from the source DOM tree component into the destination DOM tree.
P6XPATH_TYPE
Part of the XPath type system.
Definition: p6domxmltypes.h:46
P6R::P6UINT32 uResult
Definition: p6domxml.h:59
virtual P6R::P6ERR getRootNode(p6IXMLNode **pNode)=0
There is always a root node to the DOM XML tree.
P6R::P6FLOAT fResult
Definition: p6domxml.h:60
wchar_t P6WCHAR
Wide character type see p6i18n.h.
Definition: p6types.h:76
This is the main JSON interface.
Definition: p6jsonreader.h:74
This interface is implmented by components that support receiving streamed data.
Definition: p6datastream.h:42
int P6INT32
Definition: p6types.h:41
P6UINT32 P6DOMXMLFLAGS
P6DOMXMLFLAGS.
Definition: p6domxmltypes.h:96
The base interface all [p6]COM components must derive from and implement.
Definition: p6comdef.h:96
This interface is an enumerator over a set of nodes resulting from the evaluation of an XPath express...
const P6DOMOUTPUT P6DOMOUTPUT_JSONML
Definition: p6domxml.h:85
P6R::P6UINT32 strLength
Definition: p6domxml.h:54
virtual P6R::P6ERR parse(p6IDataStream **pInData)=0
This method returns an XML stream for the caller to stream the XML into.
Binary string.
Definition: p6types.h:154
const P6DOMOUTPUT P6DOMOUTPUT_KMIPJSON
Definition: p6domxml.h:87
const P6DOMOUTPUT P6DOMOUTPUT_KMIPJSON_SOLIDUS_ESCAPE
Definition: p6domxml.h:88
P6R::P6BSTR binaryResult
Definition: p6domxml.h:56
virtual P6R::P6ERR setJSONParser(p6IJSONReader *pReader)=0
The caller can use their own implementation of the p6IJSONReader interface.
This interface is an enumerator over a set of nodes resulting from the evaluation of an XPath express...
Definition: p6domnodeset.h:28
virtual P6R::P6ERR parseMessage(p6IIoBuffer *pMsg)=0
This method is used for clients that want to parse block oriented (non-streaming) messages into the D...
This component represents an element in an XML or JSON document.
Definition: p6xmlnode.h:94
const P6DOMOUTPUT P6DOMOUTPUT_KMIPXML
Definition: p6domxml.h:86
#define P6COMMETHOD
Definition: p6types.h:872
P6R::P6BOOL bResult
Definition: p6domxml.h:57
virtual P6R::P6ERR resetStripSpace()=0
Deletes all previous values defined by calls to stripSpace() method.
virtual P6R::P6ERR resetPreserveSpace()=0
Deletes all previous values defined by calls to preserveSpace() method.
double P6FLOAT
Definition: p6types.h:63
P6UINT32 P6DOMOUTPUT
P6DOMOUTPUT.
Definition: p6domxml.h:81
virtual P6R::P6ERR output(p6IDataStream *pStream, P6DOMOUTPUT flags)=0
Serialize the DOM document into the pStream parameter in one of the supported formats: { XML...
P6R::P6BSTR encodedBinary
Definition: p6domxml.h:55
virtual P6R::P6ERR isAncestorOf(const P6WCHAR *pName, P6UINT32 nameLength, const P6WCHAR *pURI, P6UINT32 uriLength, p6IXMLNode *pNode, p6IXMLNode **pFoundAncestor)=0
Is there an XML node with pName that is an ancestor somewhere in the tree of the pNode XML node...
const P6DOMOUTPUT P6DOMOUTPUT_XML
Definition: p6domxml.h:82
virtual P6R::P6ERR setSAXParser(p6ISAX2XMLReader *pReader)=0
The caller can use their own implementation of the p6ISAX2XMLReader interface.
P6R's C++ Interface of a SAX-like JSON Reader.
virtual P6R::P6ERR preserveSpace(P6WCHAR *pElementName, P6UINT32 elemLength, P6WCHAR *pNamespaceURI, P6UINT32 uriLength)=0
This method allows the application to define which XML elements should not have unnecessary white spa...
const P6DOMOUTPUT P6DOMOUTPUT_JSON
Definition: p6domxml.h:83