|
1 /* |
|
2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Generates XML from a container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef C_UPNPCONTAINERTOXML_H |
|
24 #define C_UPNPCONTAINERTOXML_H |
|
25 |
|
26 // INCLUDES |
|
27 #include <e32base.h> |
|
28 |
|
29 // CONSTANTS |
|
30 // None |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // FUNCTION PROTOTYPES |
|
36 // None |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class CUpnpContainer; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * Converts a container to xml document |
|
45 * |
|
46 * @since Series 60 3.0 |
|
47 * @lib upnpxmlparser.lib |
|
48 */ |
|
49 class CUpnpContainerToXML : public CBase |
|
50 { |
|
51 public: // Constructors and destructor |
|
52 |
|
53 /** |
|
54 * Two-phased constructor. |
|
55 * |
|
56 * @param aContainer container to convert |
|
57 * @return new instance |
|
58 */ |
|
59 static CUpnpContainerToXML* NewL( const CUpnpContainer& aContainer ); |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * |
|
64 * @param aContainer container to convert |
|
65 * @return new instance |
|
66 */ |
|
67 static CUpnpContainerToXML* NewLC( const CUpnpContainer& aContainer ); |
|
68 |
|
69 /** |
|
70 * Destructor. |
|
71 */ |
|
72 virtual ~CUpnpContainerToXML(); |
|
73 |
|
74 public: // New functions |
|
75 |
|
76 /** |
|
77 * Returns object's XML description |
|
78 * Leaves in case of errors. |
|
79 * |
|
80 * @return HBufC8 pointer to buffer containing XML data |
|
81 */ |
|
82 IMPORT_C HBufC8* AsXmlL(); |
|
83 |
|
84 /** |
|
85 * Returns object's XML description |
|
86 * Leaves in case of errors. |
|
87 * |
|
88 * @return HBufC8 pointer to buffer containing XML data |
|
89 */ |
|
90 IMPORT_C HBufC8* AsEmptyXmlL(); |
|
91 |
|
92 /** |
|
93 * Creates valid XML headers to source data. Do not decode the XML. |
|
94 * |
|
95 * @since Series 60 3.1 |
|
96 * @param TDesC8 reference to source data |
|
97 * @return HBufC8 buffer to valid XML |
|
98 */ |
|
99 HBufC8* CreateUnDecodedXmlL( const TDesC8& aData ); |
|
100 |
|
101 private: |
|
102 |
|
103 /** |
|
104 * C++ default constructor. |
|
105 */ |
|
106 CUpnpContainerToXML( const CUpnpContainer& aContainer ); |
|
107 |
|
108 /** |
|
109 * By default Symbian 2nd phase constructor is private. |
|
110 */ |
|
111 void ConstructL(); |
|
112 |
|
113 private: // Data |
|
114 |
|
115 const CUpnpContainer& iContainer; // Not own |
|
116 |
|
117 }; |
|
118 |
|
119 #endif // C_UPNPCONTAINERTOXML_H |
|
120 |
|
121 // End of File |