53 typedef void (XERCES_CPP_NAMESPACE::DOMDocument::*releaseDOMDoc) (); |
55 typedef void (XERCES_CPP_NAMESPACE::DOMDocument::*releaseDOMDoc) (); |
54 typedef void (XERCES_CPP_NAMESPACE::DOMWriter::*releaseDOMWriter) (); |
56 typedef void (XERCES_CPP_NAMESPACE::DOMWriter::*releaseDOMWriter) (); |
55 typedef void (*xmlPlatform) (); |
57 typedef void (*xmlPlatform) (); |
56 typedef void (*releaseXmlChPtr) (XMLCh** buf); |
58 typedef void (*releaseXmlChPtr) (XMLCh** buf); |
57 |
59 |
58 // constants used for writing to the xml file |
60 |
59 std::wstring PreProvisionInformation(L"PreProvisionInformation"); |
61 //------------------------------------- Literals ------------------------------------------ |
60 std::wstring SoftwareTypeName(L"SoftwareTypeName"); |
62 // Xerces literals are of type XMLCh*. For gcc XMLCh is defined as unsigned short (UCS16). |
|
63 // In windows wchar_t has the same size as XMLCh therefor literals defined as L"This is a |
|
64 // literal" will work. But in linux size of wchar_t is 4 (UCS32) bytes and hence L cannot |
|
65 // be used for defining literals. To avoid string conversion and dynamic memory allocation |
|
66 // following method is used to represent unsigned short literal. Current compiler has the |
|
67 // limitation to represent such literals. |
|
68 //----------------------------------------------------------------------------------------- |
|
69 const XMLCh* KPreProvisionInformation = (const XMLCh*) "P\0r\0e\0P\0r\0o\0v\0i\0s\0i\0o\0n\0I\0n\0f\0o\0r\0m\0a\0t\0i\0o\0n\0\0\0"; |
|
70 const XMLCh* KSoftwareTypeName = (const XMLCh*) "S\0o\0f\0t\0w\0a\0r\0e\0T\0y\0p\0e\0N\0a\0m\0e\0\0\0"; |
|
71 const XMLCh* KUTF16 = (const XMLCh*) "U\0T\0F\0-\0001\0006\0\0\0"; |
|
72 const XMLCh* KComponent = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0\0\0"; |
|
73 const XMLCh* KDependentId = (const XMLCh*) "D\0e\0p\0e\0n\0d\0e\0n\0t\0I\0d\0\0\0"; |
|
74 const XMLCh* KToVersion = (const XMLCh*) "T\0o\0V\0e\0r\0s\0i\0o\0n\0\0\0"; |
|
75 const XMLCh* KFromVersion = (const XMLCh*) "F\0r\0o\0m\0V\0e\0r\0s\0i\0o\0n\0\0\0"; |
|
76 const XMLCh* KSupplierId = (const XMLCh*) "S\0u\0p\0p\0l\0i\0e\0r\0I\0d\0\0\0"; |
|
77 const XMLCh* KName = (const XMLCh*) "N\0a\0m\0e\0\0\0"; |
|
78 const XMLCh* KFileProperty_StrValue = (const XMLCh*) "F\0i\0l\0e\0P\0r\0o\0p\0e\0r\0t\0y\0_\0S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
79 const XMLCh* KFileProperty_IntValue = (const XMLCh*) "F\0i\0l\0e\0P\0r\0o\0p\0e\0r\0t\0y\0_\0I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
80 const XMLCh* KLocation = (const XMLCh*) "L\0o\0c\0a\0t\0i\0o\0n\0\0\0"; |
|
81 const XMLCh* KComponentProperty_IsBinary = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0_\0I\0s\0B\0i\0n\0a\0r\0y\0\0\0"; |
|
82 const XMLCh* KComponentProperty_StrValue = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0_\0S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
83 const XMLCh* KComponentProperty_IntValue = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0_\0I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
84 const XMLCh* KComponentProperty_Locale = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0_\0L\0o\0c\0a\0l\0e\0\0\0"; |
|
85 const XMLCh* KComponentLocalizable_Vendor=(const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0_\0V\0e\0n\0d\0o\0r\0\0\0"; |
|
86 const XMLCh* KComponentLocalizable_Name = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0_\0N\0a\0m\0e\0\0\0"; |
|
87 const XMLCh* KComponentLocalizable_Locale=(const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0_\0L\0o\0c\0a\0l\0e\0\0\0"; |
|
88 const XMLCh* KBuild = (const XMLCh*) "B\0u\0i\0l\0d\0\0\0"; |
|
89 const XMLCh* KMinor = (const XMLCh*) "M\0i\0n\0o\0r\0\0\0"; |
|
90 const XMLCh* KMajor = (const XMLCh*) "M\0a\0j\0o\0r\0\0\0"; |
|
91 const XMLCh* KVersion = (const XMLCh*) "V\0e\0r\0s\0i\0o\0n\0\0\0"; |
|
92 const XMLCh* KHidden = (const XMLCh*) "H\0i\0d\0d\0e\0n\0\0\0"; |
|
93 const XMLCh* KOriginVerified = (const XMLCh*) "O\0r\0i\0g\0i\0n\0V\0e\0r\0i\0f\0i\0e\0d\0\0\0"; |
|
94 const XMLCh* KGlobalId = (const XMLCh*) "G\0l\0o\0b\0a\0l\0I\0d\0\0\0"; |
|
95 const XMLCh* KScomoState = (const XMLCh*) "S\0c\0o\0m\0o\0S\0t\0a\0t\0e\0\0\0"; |
|
96 const XMLCh* KSize = (const XMLCh*) "S\0i\0z\0e\0\0\0"; |
|
97 const XMLCh* KRemovable = (const XMLCh*) "R\0e\0m\0o\0v\0a\0b\0l\0e\0\0\0"; |
|
98 const XMLCh* KComponentLocalizable = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0\0\0"; |
|
99 const XMLCh* KComponentProperty = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0\0\0"; |
|
100 const XMLCh* KComponentProperty_Value = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0P\0r\0o\0p\0e\0r\0t\0y\0_\0V\0a\0l\0u\0e\0\0\0"; |
|
101 const XMLCh* KComponentFile = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0F\0i\0l\0e\0\0\0"; |
|
102 const XMLCh* KFileProperty = (const XMLCh*) "F\0i\0l\0e\0P\0r\0o\0p\0e\0r\0t\0y\0\0\0"; |
|
103 const XMLCh* KFileProperty_Value = (const XMLCh*) "F\0i\0l\0e\0P\0r\0o\0p\0e\0r\0t\0y\0_\0V\0a\0l\0u\0e\0\0\0"; |
|
104 const XMLCh* KComponentDependency = (const XMLCh*) "C\0o\0m\0p\0o\0n\0e\0n\0t\0D\0e\0p\0e\0n\0d\0e\0n\0c\0y\0\0\0"; |
|
105 const XMLCh* KDependencyList = (const XMLCh*) "D\0e\0p\0e\0n\0d\0e\0n\0c\0y\0L\0i\0s\0t\0\0\0"; |
|
106 const XMLCh* KRomApplication = (const XMLCh*) "R\0o\0m\0A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0\0\0"; |
|
107 const XMLCh* KApplicationRegistrationInfo = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0R\0e\0g\0i\0s\0t\0r\0a\0t\0i\0o\0n\0I\0n\0f\0o\0\0\0"; |
|
108 const XMLCh* KOpaqueData = (const XMLCh*) "O\0p\0a\0q\0u\0e\0D\0a\0t\0a\0\0\0"; |
|
109 const XMLCh* KData = (const XMLCh*) "D\0a\0t\0a\0\0\0"; |
|
110 const XMLCh* KOpaqueLocale = (const XMLCh*) "O\0p\0a\0q\0u\0e\0L\0o\0c\0a\0l\0e\0\0\0"; |
|
111 const XMLCh* KFileOwnershipinfo = (const XMLCh*) "F\0i\0l\0e\0O\0w\0n\0e\0r\0s\0h\0i\0p\0i\0n\0f\0o\0\0\0"; |
|
112 const XMLCh* KFileName = (const XMLCh*) "F\0i\0l\0e\0N\0a\0m\0e\0\0\0"; |
|
113 const XMLCh* KApplicationLocalizableInfo = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0I\0n\0f\0o\0\0\0"; |
|
114 const XMLCh* KLocalizableAttribute = (const XMLCh*) "L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0A\0t\0t\0r\0i\0b\0u\0t\0e\0\0\0"; |
|
115 const XMLCh* KLocalizableAttribute_Value = (const XMLCh*) "L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0V\0a\0l\0u\0e\0\0\0"; |
|
116 const XMLCh* KLocalizableAttribute_IntValue = (const XMLCh*) "L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
117 const XMLCh* KLocalizableAttribute_StrValue = (const XMLCh*) "L\0o\0c\0a\0l\0i\0z\0a\0b\0l\0e\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
118 const XMLCh* KViewData = (const XMLCh*) "V\0i\0e\0w\0D\0a\0t\0a\0\0\0"; |
|
119 const XMLCh* KViewDataAttribute = (const XMLCh*) "V\0i\0e\0w\0D\0a\0t\0a\0A\0t\0t\0r\0i\0b\0u\0t\0e\0\0\0"; |
|
120 const XMLCh* KApplicationDataType = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0D\0a\0t\0a\0T\0y\0p\0e\0\0\0"; |
|
121 const XMLCh* KPriority = (const XMLCh*) "P\0r\0i\0o\0r\0i\0t\0y\0\0\0"; |
|
122 const XMLCh* KType = (const XMLCh*) "T\0y\0p\0e\0\0\0"; |
|
123 const XMLCh* KViewData_Value = (const XMLCh*) "V\0i\0e\0w\0D\0a\0t\0a\0_\0V\0a\0l\0u\0e\0\0\0"; |
|
124 const XMLCh* KViewData_IntValue = (const XMLCh*) "V\0i\0e\0w\0D\0a\0t\0a\0_\0I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
125 const XMLCh* KViewData_StrValue = (const XMLCh*) "V\0i\0e\0w\0D\0a\0t\0a\0_\0S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
126 const XMLCh* KApplicationServiceInfo = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0S\0e\0r\0v\0i\0c\0e\0I\0n\0f\0o\0\0\0"; |
|
127 const XMLCh* KUid = (const XMLCh*) "U\0i\0d\0\0\0"; |
|
128 const XMLCh* KServiceOpaqueData = (const XMLCh*) "S\0e\0r\0v\0i\0c\0e\0O\0p\0a\0q\0u\0e\0D\0a\0t\0a\0\0\0"; |
|
129 const XMLCh* KServiceData = (const XMLCh*) "S\0e\0r\0v\0i\0c\0e\0D\0a\0t\0a\0\0\0"; |
|
130 const XMLCh* KServiceOpaqueLocale = (const XMLCh*) "S\0e\0r\0v\0i\0c\0e\0O\0p\0a\0q\0u\0e\0L\0o\0c\0a\0l\0e\0\0\0"; |
|
131 const XMLCh* KApplicationProperty = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0P\0r\0o\0p\0e\0r\0t\0y\0\0\0"; |
|
132 const XMLCh* KLocale = (const XMLCh*) "L\0o\0c\0a\0l\0e\0\0\0"; |
|
133 const XMLCh* KServiceUid = (const XMLCh*) "S\0e\0r\0v\0i\0c\0e\0U\0i\0d\0\0\0"; |
|
134 const XMLCh* KIntValue = (const XMLCh*) "I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
135 const XMLCh* KStrValue = (const XMLCh*) "S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
136 const XMLCh* KIsStr8Bit = (const XMLCh*) "I\0s\0S\0t\0r\08\0B\0i\0t\0\0\0"; |
|
137 const XMLCh* KApplicationAttribute = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0A\0t\0t\0r\0i\0b\0u\0t\0e\0\0\0"; |
|
138 const XMLCh* KApplicationAttribute_Value = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0V\0a\0l\0u\0e\0\0\0"; |
|
139 const XMLCh* KApplicationAttribute_IntValue = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0I\0n\0t\0V\0a\0l\0u\0e\0\0\0"; |
|
140 const XMLCh* KApplicationAttribute_StrValue = (const XMLCh*) "A\0p\0p\0l\0i\0c\0a\0t\0i\0o\0n\0A\0t\0t\0r\0i\0b\0u\0t\0e\0_\0S\0t\0r\0V\0a\0l\0u\0e\0\0\0"; |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 //----------------------------------------------------------------------------------------- |
|
146 |
|
147 //------------------------------------------------------------------------------------------------------------------------------ |
|
148 // UTILITY FUNCTIONS |
|
149 //------------------------------------------------------------------------------------------------------------------------------ |
|
150 |
|
151 XercesString ConvertToXercesString(const char* aString, int aLength) |
|
152 { |
|
153 XMLCh* buffer = new UTF16[aLength + 1]; |
|
154 XMLCh* temp = buffer; // save as buffer gets modified.. |
|
155 ConvertUTF8toUTF16(&aString, aString + aLength, &temp, buffer + aLength, lenientConversion); |
|
156 |
|
157 // Appending NUL to the converted buffer. |
|
158 *temp = 0; |
|
159 |
|
160 XercesString result; |
|
161 |
|
162 result.append(buffer); |
|
163 delete[] buffer; |
|
164 |
|
165 return result; |
|
166 } |
|
167 |
|
168 XercesString IntegerToXercesString(int aValue) |
|
169 { |
|
170 std::stringstream str; |
|
171 str << aValue; |
|
172 |
|
173 return ConvertToXercesString(str.str().c_str(), str.str().length()); |
|
174 } |
|
175 |
|
176 |
|
177 XercesString Int64ToXercesString(TInt64 aInt) |
|
178 { |
|
179 char str[50]; |
|
180 |
|
181 sprintf(str, "%I64u", aInt); |
|
182 |
|
183 return ConvertToXercesString(str, strlen(str)); |
|
184 } |
|
185 |
|
186 |
|
187 //------------------------------------------------------------------------------------------------------------------------------ |
61 |
188 |
62 |
189 |
63 CXmlGenerator::CXmlGenerator() |
190 CXmlGenerator::CXmlGenerator() |
64 {} |
191 {} |
65 |
192 |
84 SetWriterFeatures(domWriter.get()); |
211 SetWriterFeatures(domWriter.get()); |
85 |
212 |
86 std::auto_ptr < SchemaDomErrorHandler > errHandler(new SchemaDomErrorHandler()); |
213 std::auto_ptr < SchemaDomErrorHandler > errHandler(new SchemaDomErrorHandler()); |
87 domWriter->setErrorHandler(errHandler.get()); |
214 domWriter->setErrorHandler(errHandler.get()); |
88 |
215 |
|
216 #ifdef _WIN32 |
|
217 // XMLString::trascode() function should be used for conversion. |
89 std::auto_ptr < XMLFormatTarget > outputFile( new LocalFileFormatTarget( aXmlFileName.c_str() ) ); |
218 std::auto_ptr < XMLFormatTarget > outputFile( new LocalFileFormatTarget( aXmlFileName.c_str() ) ); |
90 |
219 #else |
91 const char* epocRoot = getenv("EPOCROOT"); |
220 std::string fileName = wstring2string(aXmlFileName); |
|
221 std::auto_ptr < XMLFormatTarget > outputFile( new LocalFileFormatTarget( fileName.c_str() ) ); |
|
222 #endif // _WIN32 |
|
223 const char* epocRoot = getenv("EPOCROOT"); |
92 if(NULL == epocRoot) |
224 if(NULL == epocRoot) |
93 { |
225 { |
94 throw std::runtime_error("EPOCROOT environment variable not specified."); |
226 throw std::runtime_error("EPOCROOT environment variable not specified."); |
95 } |
227 } |
96 |
228 |
97 std::string epocRootStr(epocRoot); |
229 std::string epocRootStr(epocRoot); |
98 |
230 |
99 std::string dtdFilePath = epocRootStr + "epoc32\\tools\\preprovision.dtd"; |
231 #ifdef __LINUX__ |
|
232 std::string dtdFilePath = epocRootStr + "epoc32/tools/preprovision.dtd"; |
|
233 #else |
|
234 std::string dtdFilePath = epocRootStr + "epoc32\\tools\\preprovision.dtd"; |
|
235 #endif |
100 |
236 |
101 fn_auto_ptr<releaseXmlChPtr, XMLCh> dtdPath( &XMLString::release, XMLString::transcode(dtdFilePath.c_str()) ); |
237 fn_auto_ptr<releaseXmlChPtr, XMLCh> dtdPath( &XMLString::release, XMLString::transcode(dtdFilePath.c_str()) ); |
102 DOMDocumentType* documentType = domImpl->createDocumentType(L"PreProvisionInformation",NULL, dtdPath.get()); |
238 DOMDocumentType* documentType = domImpl->createDocumentType(KPreProvisionInformation,NULL, dtdPath.get()); |
103 |
239 |
104 |
240 |
105 mem_fn_auto_ptr< releaseDOMDoc, DOMDocument* > domDocument( &XERCES_CPP_NAMESPACE::DOMDocument::release, domImpl->createDocument( 0, PreProvisionInformation.c_str(), documentType) ); |
241 mem_fn_auto_ptr< releaseDOMDoc, DOMDocument* > domDocument( &XERCES_CPP_NAMESPACE::DOMDocument::release, domImpl->createDocument( 0, KPreProvisionInformation, documentType) ); |
106 |
242 |
107 DOMElement* rootElement = domDocument->getDocumentElement(); |
243 DOMElement* rootElement = domDocument->getDocumentElement(); |
108 |
244 |
109 // SoftwareTypeName |
245 // SoftwareTypeName |
110 AddChildElement(rootElement, domDocument.get(), SoftwareTypeName.c_str(), aPreProvisionDetail.iSoftwareTypeName.c_str() ); |
246 AddChildElement(rootElement, domDocument.get(), KSoftwareTypeName, aPreProvisionDetail.SoftwareTypeName().c_str() ); |
111 |
247 |
112 std::vector<XmlDetails::TScrPreProvisionDetail::TComponent>::const_iterator compIter; |
248 std::vector<XmlDetails::TScrPreProvisionDetail::TComponent>::const_iterator compIter; |
113 for(compIter = aPreProvisionDetail.iComponents.begin(); compIter != aPreProvisionDetail.iComponents.end() ; ++compIter) |
249 for(compIter = aPreProvisionDetail.iComponents.begin(); compIter != aPreProvisionDetail.iComponents.end() ; ++compIter) |
114 { |
250 { |
115 DOMElement* component = domDocument->createElement(L"Component"); |
251 DOMElement* component = domDocument->createElement(KComponent); |
116 rootElement->appendChild(component); |
252 rootElement->appendChild(component); |
117 |
253 |
118 WriteComponent(component,domDocument.get(), *compIter, aRomApplication); |
254 WriteComponent(component,domDocument.get(), *compIter, aRomApplication); |
119 } |
255 } |
120 |
|
121 // do the serialization through DOMWriter::writeNode(); |
256 // do the serialization through DOMWriter::writeNode(); |
122 domWriter->writeNode(outputFile.get(), *domDocument.get()); |
257 domWriter->writeNode(outputFile.get(), *domDocument.get()); |
123 |
|
124 } |
258 } |
125 catch (const XMLException& toCatch) |
259 catch (const XMLException& toCatch) |
126 { |
260 { |
127 char* message = XMLString::transcode(toCatch.getMessage()); |
261 char* message = XMLString::transcode(toCatch.getMessage()); |
128 XMLString::release(&message); |
262 XMLString::release(&message); |
173 { |
307 { |
174 |
308 |
175 if (aRomApplication) |
309 if (aRomApplication) |
176 { |
310 { |
177 int isRomApplication = 1; |
311 int isRomApplication = 1; |
178 std::wstring isRomApp = Utils::IntegerToWideString(isRomApplication); |
312 XercesString isRomApp = IntegerToXercesString(isRomApplication); |
179 AddChildElement(aRootElement, aDocument, L"RomApplication", isRomApp.c_str()); |
313 AddChildElement(aRootElement, aDocument, KRomApplication, isRomApp.c_str()); |
180 } |
314 } |
181 |
315 |
182 std::wstring isRemovable = Utils::IntegerToWideString(aComponent.iComponentDetails.iIsRemovable); |
316 XercesString isRemovable = IntegerToXercesString(aComponent.iComponentDetails.iIsRemovable); |
183 AddChildElement(aRootElement, aDocument, L"Removable", isRemovable.c_str() ); |
317 AddChildElement(aRootElement, aDocument, KRemovable, isRemovable.c_str() ); |
184 |
318 |
185 std::wstring size = Utils::Int64ToWideString(aComponent.iComponentDetails.iSize); |
319 |
186 AddChildElement(aRootElement, aDocument, L"Size", size.c_str() ); |
320 XercesString size = Int64ToXercesString(aComponent.iComponentDetails.iSize); |
187 |
321 AddChildElement(aRootElement, aDocument, KSize, size.c_str() ); |
188 std::wstring scomoState = Utils::IntegerToWideString(aComponent.iComponentDetails.iScomoState); |
322 |
189 AddChildElement(aRootElement, aDocument, L"ScomoState", scomoState.c_str() ); |
323 XercesString scomoState = IntegerToXercesString(aComponent.iComponentDetails.iScomoState); |
190 |
324 AddChildElement(aRootElement, aDocument, KScomoState, scomoState.c_str() ); |
191 AddChildElement(aRootElement, aDocument, L"GlobalId", aComponent.iComponentDetails.iGlobalId.c_str() ); |
325 |
|
326 AddChildElement(aRootElement, aDocument, KGlobalId, aComponent.iComponentDetails.GlobalId().c_str() ); |
192 |
327 |
193 WriteComponentVersion(aRootElement, aDocument, aComponent.iComponentDetails.iVersion); |
328 WriteComponentVersion(aRootElement, aDocument, aComponent.iComponentDetails.iVersion); |
194 |
329 |
195 std::wstring isOriginVerified = Utils::IntegerToWideString(aComponent.iComponentDetails.iOriginVerified); |
330 XercesString isOriginVerified = Int64ToXercesString(aComponent.iComponentDetails.iOriginVerified); |
196 AddChildElement(aRootElement, aDocument, L"OriginVerified", isOriginVerified.c_str() ); |
331 AddChildElement(aRootElement, aDocument, KOriginVerified, isOriginVerified.c_str() ); |
197 |
332 |
198 std::wstring isHidden = Utils::IntegerToWideString(aComponent.iComponentDetails.iIsHidden); |
333 XercesString isHidden = IntegerToXercesString(aComponent.iComponentDetails.iIsHidden); |
199 AddChildElement(aRootElement, aDocument, L"Hidden", isHidden.c_str() ); |
334 AddChildElement(aRootElement, aDocument, KHidden, isHidden.c_str() ); |
200 |
335 |
201 WriteComponentLocalizables(aRootElement, aDocument, aComponent.iComponentLocalizables); |
336 WriteComponentLocalizables(aRootElement, aDocument, aComponent.iComponentLocalizables); |
202 |
337 |
203 WriteComponentProperties(aRootElement, aDocument, aComponent.iComponentProperties); |
338 WriteComponentProperties(aRootElement, aDocument, aComponent.iComponentProperties); |
204 |
339 |
249 { |
386 { |
250 std::vector<ComponentProperty>::const_iterator compPropIter; |
387 std::vector<ComponentProperty>::const_iterator compPropIter; |
251 for( compPropIter = aComponentProperties.begin() ; compPropIter != aComponentProperties.end() ; ++compPropIter) |
388 for( compPropIter = aComponentProperties.begin() ; compPropIter != aComponentProperties.end() ; ++compPropIter) |
252 { |
389 { |
253 |
390 |
254 DOMElement* compPropRoot = AddTag(aRootElement, aDocument, L"ComponentProperty"); |
391 DOMElement* compPropRoot = AddTag(aRootElement, aDocument, KComponentProperty); |
255 |
392 |
256 std::wstring locale = Utils::IntegerToWideString(compPropIter->iLocale); |
393 XercesString locale = IntegerToXercesString(compPropIter->iLocale); |
257 AddChildElement(compPropRoot,aDocument, L"ComponentProperty_Locale", locale.c_str()); |
394 AddChildElement(compPropRoot,aDocument, KComponentProperty_Locale, locale.c_str()); |
258 |
395 |
259 DOMElement* compPropValueRoot = AddTag(compPropRoot, aDocument, L"ComponentProperty_Value"); |
396 DOMElement* compPropValueRoot = AddTag(compPropRoot, aDocument, KComponentProperty_Value); |
260 |
397 |
261 std::wstring isBinary = Utils::IntegerToWideString(compPropIter->iIsStr8Bit); |
398 XercesString isBinary = IntegerToXercesString(compPropIter->iIsStr8Bit); |
262 |
399 |
263 if(compPropIter->iIsIntValue) |
400 if(compPropIter->iIsIntValue) |
264 { |
401 { |
265 AddChildElement(compPropValueRoot,aDocument, L"ComponentProperty_IntValue", compPropIter->iValue.c_str()); |
402 AddChildElement(compPropValueRoot,aDocument, KComponentProperty_IntValue, compPropIter->Value().c_str()); |
266 } |
403 } |
267 else |
404 else |
268 { |
405 { |
269 AddChildElement(compPropValueRoot,aDocument, L"ComponentProperty_StrValue", compPropIter->iValue.c_str()); |
406 AddChildElement(compPropValueRoot,aDocument, KComponentProperty_StrValue, compPropIter->Value().c_str()); |
270 } |
407 } |
271 |
408 |
272 |
409 |
273 AddChildElement(compPropRoot,aDocument, L"ComponentProperty_IsBinary", isBinary.c_str()); |
410 AddChildElement(compPropRoot,aDocument, KComponentProperty_IsBinary, isBinary.c_str()); |
274 |
411 |
275 compPropRoot->setAttribute(L"Name", compPropIter->iName.c_str()); |
412 compPropRoot->setAttribute(KName, compPropIter->Name().c_str()); |
276 |
413 |
277 } |
414 } |
278 } |
415 } |
279 |
416 |
280 |
417 |
289 ) |
426 ) |
290 { |
427 { |
291 std::vector<AppRegistrationInfo>::const_iterator compFileIter; |
428 std::vector<AppRegistrationInfo>::const_iterator compFileIter; |
292 for( compFileIter = aAppRegInfo.begin() ; compFileIter != aAppRegInfo.end() ; ++compFileIter) |
429 for( compFileIter = aAppRegInfo.begin() ; compFileIter != aAppRegInfo.end() ; ++compFileIter) |
293 { |
430 { |
294 DOMElement* compFileRoot = AddTag(aRootElement, aDocument, L"ApplicationRegistrationInfo"); |
431 DOMElement* compFileRoot = AddTag(aRootElement, aDocument, KApplicationRegistrationInfo); |
295 |
432 |
296 WriteAppAttributes(compFileRoot, aDocument, compFileIter->iApplicationAttribute); |
433 WriteAppAttributes(compFileRoot, aDocument, compFileIter->iApplicationAttribute); |
297 |
434 |
298 const std::vector<AppOpaqueDataType>& aAppOpaqueDataType = compFileIter->iOpaqueDataType; |
435 const std::vector<AppOpaqueDataType>& aAppOpaqueDataType = compFileIter->iOpaqueDataType; |
299 std::vector<AppOpaqueDataType>::const_iterator fileAppOpaqueDataType; |
436 std::vector<AppOpaqueDataType>::const_iterator fileAppOpaqueDataType; |
300 |
437 |
301 for( fileAppOpaqueDataType = aAppOpaqueDataType.begin() ; fileAppOpaqueDataType != aAppOpaqueDataType.end() ; ++fileAppOpaqueDataType) |
438 for( fileAppOpaqueDataType = aAppOpaqueDataType.begin() ; fileAppOpaqueDataType != aAppOpaqueDataType.end() ; ++fileAppOpaqueDataType) |
302 { |
439 { |
303 if(0 == fileAppOpaqueDataType->iServiceUid) |
440 if(0 == fileAppOpaqueDataType->iServiceUid) |
304 { |
441 { |
305 DOMElement* filePropValueRoot = AddTag(compFileRoot, aDocument, L"OpaqueData"); |
442 DOMElement* filePropValueRoot = AddTag(compFileRoot, aDocument, KOpaqueData); |
306 AddChildElement(filePropValueRoot,aDocument, L"Data", fileAppOpaqueDataType->iOpaqueData.c_str()); |
443 XercesString opaqueData = WStringToXercesString(fileAppOpaqueDataType->iOpaqueData); |
307 std::wstring iLocale = Utils::IntegerToWideString(fileAppOpaqueDataType->iLocale); |
444 AddChildElement(filePropValueRoot,aDocument, KData, opaqueData.c_str()); |
308 AddChildElement(filePropValueRoot,aDocument, L"OpaqueLocale", iLocale.c_str()); |
445 XercesString locale = IntegerToXercesString(fileAppOpaqueDataType->iLocale); |
|
446 AddChildElement(filePropValueRoot,aDocument, KOpaqueLocale, locale.c_str()); |
309 } |
447 } |
310 } |
448 } |
311 |
449 |
312 for(vector<std::wstring>::iterator mimeiter = compFileIter->iFileOwnershipInfo.begin() ; mimeiter != compFileIter->iFileOwnershipInfo.end() ; ++mimeiter ) |
450 for(vector<std::wstring>::iterator mimeiter = compFileIter->iFileOwnershipInfo.begin() ; mimeiter != compFileIter->iFileOwnershipInfo.end() ; ++mimeiter ) |
313 { |
451 { |
314 DOMElement* filePropRoot = AddTag(compFileRoot, aDocument, L"FileOwnershipinfo"); |
452 DOMElement* filePropRoot = AddTag(compFileRoot, aDocument, KFileOwnershipinfo); |
315 |
453 |
316 AddChildElement(filePropRoot,aDocument, L"FileName", mimeiter->c_str()); |
454 XercesString temp = WStringToXercesString(*mimeiter); |
|
455 AddChildElement(filePropRoot,aDocument, KFileName, temp.c_str()); |
317 } |
456 } |
318 |
457 |
319 WriteAppServiceInfo(compFileRoot, aDocument, compFileIter->iApplicationServiceInfo, compFileIter->iOpaqueDataType); |
458 WriteAppServiceInfo(compFileRoot, aDocument, compFileIter->iApplicationServiceInfo, compFileIter->iOpaqueDataType); |
320 WriteAppLocalizableInfo(compFileRoot, aDocument, compFileIter->iApplicationLocalizableInfo); |
459 WriteAppLocalizableInfo(compFileRoot, aDocument, compFileIter->iApplicationLocalizableInfo); |
321 } |
460 } |
352 ) |
491 ) |
353 { |
492 { |
354 std::vector<AppLocalizableAttribute>::const_iterator filePropIter; |
493 std::vector<AppLocalizableAttribute>::const_iterator filePropIter; |
355 for( filePropIter = aAppLocalizableAttribute.begin() ; filePropIter != aAppLocalizableAttribute.end() ; ++filePropIter) |
494 for( filePropIter = aAppLocalizableAttribute.begin() ; filePropIter != aAppLocalizableAttribute.end() ; ++filePropIter) |
356 { |
495 { |
357 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"LocalizableAttribute"); |
496 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KLocalizableAttribute); |
358 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, L"LocalizableAttribute_Value"); |
497 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, KLocalizableAttribute_Value); |
359 |
498 |
|
499 XercesString value = WStringToXercesString(filePropIter->iValue); |
360 if(filePropIter->iIsIntValue) |
500 if(filePropIter->iIsIntValue) |
361 { |
501 { |
362 AddChildElement(filePropValueRoot, aDocument, L"LocalizableAttribute_IntValue", filePropIter->iValue.c_str()); |
502 AddChildElement(filePropValueRoot, aDocument, KLocalizableAttribute_IntValue, value.c_str()); |
363 } |
503 } |
364 else |
504 else |
365 { |
505 { |
366 AddChildElement(filePropValueRoot, aDocument, L"LocalizableAttribute_StrValue", filePropIter->iValue.c_str()); |
506 AddChildElement(filePropValueRoot, aDocument, KLocalizableAttribute_StrValue, value.c_str()); |
367 } |
507 } |
368 filePropRoot->setAttribute(L"Name", filePropIter->iName.c_str()); |
508 XercesString name = WStringToXercesString(filePropIter->iName); |
|
509 filePropRoot->setAttribute(KName, name.c_str()); |
369 } |
510 } |
370 } |
511 } |
371 |
512 |
372 /** |
513 /** |
373 * Writes Class TAppViewData Info in XML. |
514 * Writes Class TAppViewData Info in XML. |
394 ) |
535 ) |
395 { |
536 { |
396 std::vector<AppViewDataAttributes>::const_iterator filePropIter; |
537 std::vector<AppViewDataAttributes>::const_iterator filePropIter; |
397 for( filePropIter = aAppViewDataAttributes.begin() ; filePropIter != aAppViewDataAttributes.end() ; ++filePropIter) |
538 for( filePropIter = aAppViewDataAttributes.begin() ; filePropIter != aAppViewDataAttributes.end() ; ++filePropIter) |
398 { |
539 { |
399 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"ViewDataAttribute"); |
540 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KViewDataAttribute); |
400 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, L"ViewData_Value"); |
541 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, KViewData_Value); |
401 |
542 |
|
543 XercesString value = WStringToXercesString(filePropIter->iValue); |
402 if(filePropIter->iIsIntValue) |
544 if(filePropIter->iIsIntValue) |
403 { |
545 { |
404 AddChildElement(filePropValueRoot, aDocument, L"ViewData_IntValue", filePropIter->iValue.c_str()); |
546 AddChildElement(filePropValueRoot, aDocument, KViewData_IntValue, value.c_str()); |
|
547 |
405 } |
548 } |
406 else |
549 else |
407 { |
550 { |
408 AddChildElement(filePropValueRoot, aDocument, L"ViewData_StrValue", filePropIter->iValue.c_str()); |
551 AddChildElement(filePropValueRoot, aDocument, KViewData_StrValue, value.c_str()); |
|
552 |
409 } |
553 } |
410 filePropRoot->setAttribute(L"Name", filePropIter->iName.c_str()); |
554 |
|
555 XercesString name = WStringToXercesString(filePropIter->iName); |
|
556 filePropRoot->setAttribute(KName, name.c_str()); |
411 } |
557 } |
412 } |
558 } |
413 |
559 |
414 /** |
560 /** |
415 * Writes Class TAppServiceInfo Info in XML. |
561 * Writes Class TAppServiceInfo Info in XML. |
424 { |
570 { |
425 std::vector<AppServiceInfo>::const_iterator filePropIter; |
571 std::vector<AppServiceInfo>::const_iterator filePropIter; |
426 std::vector<AppOpaqueDataType>::const_iterator fileAppPropIter; |
572 std::vector<AppOpaqueDataType>::const_iterator fileAppPropIter; |
427 for( filePropIter = aAppServiceInfo.begin() ; filePropIter != aAppServiceInfo.end() ; ++filePropIter) |
573 for( filePropIter = aAppServiceInfo.begin() ; filePropIter != aAppServiceInfo.end() ; ++filePropIter) |
428 { |
574 { |
429 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"ApplicationServiceInfo"); |
575 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KApplicationServiceInfo); |
430 |
576 |
431 std::wstring iUid = Utils::IntegerToWideString(filePropIter->iUid); |
577 XercesString uid = IntegerToXercesString(filePropIter->iUid); |
432 AddChildElement(filePropRoot,aDocument, L"Uid", iUid.c_str()); |
578 AddChildElement(filePropRoot,aDocument, KUid, uid.c_str()); |
|
579 |
433 |
580 |
434 for( fileAppPropIter = aAppOpaqueData.begin() ; fileAppPropIter != aAppOpaqueData.end() ; ++fileAppPropIter) |
581 for( fileAppPropIter = aAppOpaqueData.begin() ; fileAppPropIter != aAppOpaqueData.end() ; ++fileAppPropIter) |
435 { |
582 { |
436 if(filePropIter->iUid == fileAppPropIter->iServiceUid) |
583 if(filePropIter->iUid == fileAppPropIter->iServiceUid) |
437 { |
584 { |
438 if(!fileAppPropIter->iOpaqueData.empty()) |
585 if(!fileAppPropIter->iOpaqueData.empty()) |
439 { |
586 { |
440 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, L"ServiceOpaqueData"); |
587 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, KServiceOpaqueData); |
441 AddChildElement(filePropValueRoot,aDocument, L"ServiceData", fileAppPropIter->iOpaqueData.c_str()); |
588 |
442 std::wstring iLocale = Utils::IntegerToWideString(fileAppPropIter->iLocale); |
589 XercesString opaqueData = WStringToXercesString(fileAppPropIter->iOpaqueData); |
443 AddChildElement(filePropValueRoot,aDocument, L"ServiceOpaqueLocale", iLocale.c_str()); |
590 AddChildElement(filePropValueRoot,aDocument, KServiceData, opaqueData.c_str()); |
|
591 |
|
592 XercesString locale = IntegerToXercesString(fileAppPropIter->iLocale); |
|
593 AddChildElement(filePropValueRoot,aDocument, KServiceOpaqueLocale, locale.c_str()); |
444 } |
594 } |
445 } |
595 } |
446 } |
596 } |
447 |
597 |
448 WriteAppDataType(filePropRoot, aDocument, filePropIter->iDataType); |
598 WriteAppDataType(filePropRoot, aDocument, filePropIter->iDataType); |
481 ) |
633 ) |
482 { |
634 { |
483 std::vector<ApplicationAttribute>::const_iterator filePropIter; |
635 std::vector<ApplicationAttribute>::const_iterator filePropIter; |
484 for( filePropIter = aAppAttributes.begin() ; filePropIter != aAppAttributes.end() ; ++filePropIter) |
636 for( filePropIter = aAppAttributes.begin() ; filePropIter != aAppAttributes.end() ; ++filePropIter) |
485 { |
637 { |
486 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"ApplicationAttribute"); |
638 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KApplicationAttribute); |
487 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, L"ApplicationAttribute_Value"); |
639 |
488 |
640 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, KApplicationAttribute_Value); |
|
641 |
|
642 XercesString value = WStringToXercesString(filePropIter->iValue); |
489 if(filePropIter->iIsIntValue) |
643 if(filePropIter->iIsIntValue) |
490 { |
644 { |
491 AddChildElement(filePropValueRoot, aDocument, L"ApplicationAttribute_IntValue", filePropIter->iValue.c_str()); |
645 AddChildElement(filePropValueRoot, aDocument, KApplicationAttribute_IntValue, value.c_str()); |
492 } |
646 } |
493 else |
647 else |
494 { |
648 { |
495 AddChildElement(filePropValueRoot, aDocument, L"ApplicationAttribute_StrValue", filePropIter->iValue.c_str()); |
649 AddChildElement(filePropValueRoot, aDocument, KApplicationAttribute_StrValue, value.c_str()); |
496 } |
650 } |
497 filePropRoot->setAttribute(L"Name", filePropIter->iName.c_str()); |
651 |
|
652 XercesString name = WStringToXercesString(filePropIter->iName); |
|
653 filePropRoot->setAttribute(KName, name.c_str()); |
498 } |
654 } |
499 } |
655 } |
500 |
656 |
501 /** |
657 /** |
502 * Writes Class TApplicationProperty Info in XML. |
658 * Writes Class TApplicationProperty Info in XML. |
508 ) |
664 ) |
509 { |
665 { |
510 std::vector<AppProperty>::const_iterator filePropIter; |
666 std::vector<AppProperty>::const_iterator filePropIter; |
511 for( filePropIter = aAppProperty.begin() ; filePropIter != aAppProperty.end() ; ++filePropIter) |
667 for( filePropIter = aAppProperty.begin() ; filePropIter != aAppProperty.end() ; ++filePropIter) |
512 { |
668 { |
513 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"ApplicationProperty"); |
669 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KApplicationProperty); |
514 |
670 |
515 |
671 XercesString locale = IntegerToXercesString(filePropIter->iLocale); |
516 std::wstring iLocale = Utils::IntegerToWideString(filePropIter->iLocale); |
672 AddChildElement(filePropRoot,aDocument, KLocale, locale.c_str()); |
517 AddChildElement(filePropRoot,aDocument, L"Locale", iLocale.c_str()); |
673 |
518 |
674 XercesString name = WStringToXercesString(filePropIter->iName); |
519 AddChildElement(filePropRoot,aDocument, L"Name", filePropIter->iName.c_str()); |
675 AddChildElement(filePropRoot,aDocument, KName, name.c_str()); |
520 |
676 |
521 std::wstring iServiceUid = Utils::IntegerToWideString(filePropIter->iServiceUid); |
677 XercesString serviceUid = IntegerToXercesString(filePropIter->iServiceUid); |
522 AddChildElement(filePropRoot,aDocument, L"ServiceUid", iServiceUid.c_str()); |
678 AddChildElement(filePropRoot,aDocument, KServiceUid, serviceUid.c_str()); |
523 |
679 |
524 std::wstring iIntValue = Utils::IntegerToWideString(filePropIter->iIntValue); |
680 XercesString intValue = IntegerToXercesString(filePropIter->iIntValue); |
525 AddChildElement(filePropRoot,aDocument, L"IntValue", iIntValue.c_str()); |
681 AddChildElement(filePropRoot,aDocument, KIntValue, intValue.c_str()); |
526 |
682 |
527 AddChildElement(filePropRoot, aDocument, L"StrValue", filePropIter->iStrValue.c_str()); |
683 XercesString strValue = WStringToXercesString(filePropIter->iStrValue); |
528 |
684 AddChildElement(filePropRoot, aDocument, KStrValue, strValue.c_str()); |
529 std::wstring iIsStr8Bit = Utils::IntegerToWideString(filePropIter->iIsStr8Bit); |
685 |
530 AddChildElement(filePropRoot,aDocument, L"IsStr8Bit", iIsStr8Bit.c_str()); |
686 XercesString isStr8Bit = IntegerToXercesString(filePropIter->iIsStr8Bit); |
531 |
687 AddChildElement(filePropRoot,aDocument, KIsStr8Bit, isStr8Bit.c_str()); |
532 } |
688 } |
533 } |
689 } |
534 |
690 |
535 void CXmlGenerator::WriteComponentFiles |
691 void CXmlGenerator::WriteComponentFiles |
536 ( |
692 ( |
556 ) |
712 ) |
557 { |
713 { |
558 std::vector<FileProperty>::const_iterator filePropIter; |
714 std::vector<FileProperty>::const_iterator filePropIter; |
559 for( filePropIter = aFileProperties.begin() ; filePropIter != aFileProperties.end() ; ++filePropIter) |
715 for( filePropIter = aFileProperties.begin() ; filePropIter != aFileProperties.end() ; ++filePropIter) |
560 { |
716 { |
561 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, L"FileProperty"); |
717 DOMElement* filePropRoot = AddTag(aRootElement, aDocument, KFileProperty); |
562 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, L"FileProperty_Value"); |
718 DOMElement* filePropValueRoot = AddTag(filePropRoot, aDocument, KFileProperty_Value); |
563 |
719 |
564 if(filePropIter->iIsIntValue) |
720 if(filePropIter->iIsIntValue) |
565 { |
721 { |
566 AddChildElement(filePropValueRoot, aDocument, L"FileProperty_IntValue", filePropIter->iValue.c_str()); |
722 AddChildElement(filePropValueRoot, aDocument, KFileProperty_IntValue, filePropIter->Value().c_str()); |
567 } |
723 } |
568 else |
724 else |
569 { |
725 { |
570 AddChildElement(filePropValueRoot, aDocument, L"FileProperty_StrValue", filePropIter->iValue.c_str()); |
726 AddChildElement(filePropValueRoot, aDocument, KFileProperty_StrValue, filePropIter->Value().c_str()); |
571 } |
727 } |
572 filePropRoot->setAttribute(L"Name", filePropIter->iName.c_str()); |
728 filePropRoot->setAttribute(KName, filePropIter->Name().c_str()); |
573 } |
729 } |
574 } |
730 } |
575 |
731 |
576 |
732 |
577 void CXmlGenerator::WriteComponentDependencies |
733 void CXmlGenerator::WriteComponentDependencies |
585 return; |
741 return; |
586 |
742 |
587 std::vector<ComponentDependencyDetail> componentDependencyList = aComponentDependency.iComponentDependencyList; |
743 std::vector<ComponentDependencyDetail> componentDependencyList = aComponentDependency.iComponentDependencyList; |
588 std::vector<ComponentDependencyDetail>::const_iterator compDepIter; |
744 std::vector<ComponentDependencyDetail>::const_iterator compDepIter; |
589 |
745 |
590 DOMElement* compDepRoot = AddTag(aRootElement, aDocument, L"ComponentDependency"); |
746 DOMElement* compDepRoot = AddTag(aRootElement, aDocument, KComponentDependency); |
591 |
747 |
592 for( compDepIter = componentDependencyList.begin() ; compDepIter != componentDependencyList.end() ; ++compDepIter) |
748 for( compDepIter = componentDependencyList.begin() ; compDepIter != componentDependencyList.end() ; ++compDepIter) |
593 { |
749 { |
594 DOMElement* compDepListRoot = AddTag( compDepRoot, aDocument, L"DependencyList" ); |
750 DOMElement* compDepListRoot = AddTag( compDepRoot, aDocument, KDependencyList ); |
595 AddChildElement( compDepListRoot, aDocument, L"SupplierId", compDepIter->iSupplierId.c_str() ); |
751 AddChildElement( compDepListRoot, aDocument, KSupplierId, compDepIter->SupplierId().c_str() ); |
596 AddChildElement( compDepListRoot, aDocument, L"FromVersion", compDepIter->iFromVersion.c_str() ); |
752 AddChildElement( compDepListRoot, aDocument, KFromVersion, compDepIter->FromVersion().c_str() ); |
597 AddChildElement( compDepListRoot, aDocument, L"ToVersion", compDepIter->iToVersion.c_str() ); |
753 AddChildElement( compDepListRoot, aDocument, KToVersion, compDepIter->ToVersion().c_str() ); |
598 } |
754 } |
599 compDepRoot->setAttribute(L"DependentId", aComponentDependency.iDependentId.c_str()); |
755 compDepRoot->setAttribute(KDependentId, aComponentDependency.DependentId().c_str()); |
600 } |
756 } |
601 |
757 |
602 |
758 |
603 void CXmlGenerator::AddChildElement( DOMElement* aRootElement, DOMDocument* aDocument, const wchar_t* aElementName, const wchar_t* aTextValue ) |
759 void CXmlGenerator::AddChildElement( DOMElement* aRootElement, DOMDocument* aDocument, const XMLCh* aElementName, const XMLCh* aTextValue ) |
604 { |
760 { |
605 DOMElement* element = aDocument->createElement(aElementName); |
761 DOMElement* element = aDocument->createElement(aElementName); |
606 aRootElement->appendChild(element); |
762 aRootElement->appendChild(element); |
607 |
763 |
608 DOMText* textValue = aDocument->createTextNode(aTextValue); |
764 DOMText* textValue = aDocument->createTextNode(aTextValue); |
609 element->appendChild(textValue); |
765 element->appendChild(textValue); |
610 } |
766 } |
611 |
767 |
612 DOMElement* CXmlGenerator::AddTag( DOMElement* aRootElement, DOMDocument* aDocument, const wchar_t* aTagName) |
768 DOMElement* CXmlGenerator::AddTag( DOMElement* aRootElement, DOMDocument* aDocument, const XMLCh* aTagName) |
613 { |
769 { |
614 DOMElement* tagName = aDocument->createElement(aTagName); |
770 DOMElement* tagName = aDocument->createElement(aTagName); |
615 aRootElement->appendChild(tagName); |
771 aRootElement->appendChild(tagName); |
616 |
772 |
617 return tagName; |
773 return tagName; |