secureswitools/swisistools/source/interpretsislib/xmlgenerator.h
branchRCL_3
changeset 25 7333d7932ef7
parent 0 ba25891c3a9e
child 26 8b7f4e561641
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
     1 /*
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    36 #include "xmlparser.h"
    36 #include "xmlparser.h"
    37 #include <xercesc/parsers/XercesDOMParser.hpp>
    37 #include <xercesc/parsers/XercesDOMParser.hpp>
    38 #include <xercesc/sax/ErrorHandler.hpp>
    38 #include <xercesc/sax/ErrorHandler.hpp>
    39 #include <xercesc/dom/DOM.hpp>
    39 #include <xercesc/dom/DOM.hpp>
    40 
    40 
    41 
    41 #include "parameterlist.h"
       
    42 
       
    43 using namespace std;
       
    44 
       
    45 #define AppRegistrationInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo
       
    46 #define ApplicationAttribute XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppAttribute 
       
    47 #define AppDataType XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TDataType 
       
    48 #define AppServiceInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppServiceInfo 
       
    49 #define AppLocalizableInfo XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo
       
    50 #define AppLocalizableAttribute XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TLocalizableAttribute 
       
    51 #define AppViewData XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData 
       
    52 #define AppViewDataAttributes XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppLocalizableInfo::TViewData::TViewDataAttributes 
       
    53 #define AppProperty XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TAppProperty 
       
    54 #define AppOpaqueDataType XmlDetails::TScrPreProvisionDetail::TApplicationRegistrationInfo::TOpaqueDataType
    42 #define ComponentLocalizable XmlDetails::TScrPreProvisionDetail::TComponentLocalizable
    55 #define ComponentLocalizable XmlDetails::TScrPreProvisionDetail::TComponentLocalizable
    43 #define ComponentProperty XmlDetails::TScrPreProvisionDetail::TComponentProperty
    56 #define ComponentProperty XmlDetails::TScrPreProvisionDetail::TComponentProperty
    44 #define ComponentFile XmlDetails::TScrPreProvisionDetail::TComponentFile
    57 #define ComponentFile XmlDetails::TScrPreProvisionDetail::TComponentFile
    45 #define FileProperty XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty
    58 #define FileProperty XmlDetails::TScrPreProvisionDetail::TComponentFile::TFileProperty
    46 #define ComponentDependency XmlDetails::TScrPreProvisionDetail::TComponentDependency
    59 #define ComponentDependency XmlDetails::TScrPreProvisionDetail::TComponentDependency
    47 #define ComponentDependencyDetail XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail
    60 #define ComponentDependencyDetail XmlDetails::TScrPreProvisionDetail::TComponentDependency::TComponentDependencyDetail
    48 
    61 
       
    62 
    49 class CXmlGenerator
    63 class CXmlGenerator
    50 	{
    64 	{
    51 
    65 
    52 	public:
    66 	public:
    53 		
    67 		
    62 		~CXmlGenerator();
    76 		~CXmlGenerator();
    63 		
    77 		
    64 		/**
    78 		/**
    65 		 * Retrieves software environment details, from the supplied xml file. 
    79 		 * Retrieves software environment details, from the supplied xml file. 
    66 		 */
    80 		 */
    67 		void WritePreProvisionDetails(const std::wstring aXmlFileName, const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetail);
    81 		void WritePreProvisionDetails(const std::wstring aXmlFileName, 
       
    82 											const XmlDetails::TScrPreProvisionDetail& aPreProvisionDetail,
       
    83 											int& aRomApplication
       
    84 										);
    68 		
    85 		
    69 		
    86 		
    70 	private:	
    87 	private:	
    71 
    88 
    72 		void WriteComponent(	XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
    89 		void WriteComponent(	XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
    73 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
    90 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
    74 								const XmlDetails::TScrPreProvisionDetail::TComponent& aComponent
    91 								const XmlDetails::TScrPreProvisionDetail::TComponent& aComponent,
       
    92 								int& aRomApplication
    75 							);
    93 							);
    76 
    94 
    77 		void WriteComponentVersion	(	
    95 		void WriteComponentVersion	(	
    78 										XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
    96 										XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
    79 										XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
    97 										XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
    92 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   110 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
    93 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   111 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
    94 						const std::vector<ComponentProperty>& aComponentProperties 
   112 						const std::vector<ComponentProperty>& aComponentProperties 
    95 					);
   113 					);
    96 
   114 
       
   115 		void WriteAppRegInfo	
       
   116 					( 
       
   117 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   118 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   119 						const std::vector<AppRegistrationInfo>& aAppRegInfo 
       
   120 					);
       
   121 
       
   122 
       
   123 		void WriteAppAttributes	
       
   124 					( 
       
   125 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   126 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   127 						const std::vector<ApplicationAttribute>& aAppAttributes 
       
   128 					);
       
   129 
       
   130 		void WriteAppProperty	
       
   131 					( 
       
   132 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   133 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   134 						const std::vector<AppProperty>& aAppProperty 
       
   135 					);
       
   136 
       
   137 		void WriteAppServiceInfo 
       
   138 					( 
       
   139 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   140 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   141 						const std::vector<AppServiceInfo>& aAppServiceInfo,
       
   142 						const std::vector<AppOpaqueDataType>& aAppOpaqueData
       
   143 					);
       
   144 
       
   145 		void WriteAppDataType 
       
   146 					( 
       
   147 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   148 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   149 						const std::vector<AppDataType>& aAppDataType 
       
   150 					);
       
   151 
       
   152 		void WriteAppLocalizableInfo 
       
   153 					( 
       
   154 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   155 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   156 						const std::vector<AppLocalizableInfo>& aAppLocalizableInfo 
       
   157 					);
       
   158 
       
   159 		void WriteAppLocalizableAttribute 
       
   160 					( 
       
   161 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   162 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   163 						const std::vector<AppLocalizableAttribute>& aAppLocalizableAttribute 
       
   164 					);
       
   165 
       
   166 		void WriteAppLocalizableViewData 
       
   167 					( 
       
   168 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   169 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   170 						const std::vector<AppViewData>& aAppViewData 
       
   171 					);
       
   172 
       
   173 		void WriteAppLocalizableViewDataAttributes 
       
   174 					 ( 
       
   175  						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
       
   176 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
       
   177 						const std::vector<AppViewDataAttributes>& aAppViewDataAttributes 
       
   178 					 );
       
   179 
    97 		void WriteComponentFiles	
   180 		void WriteComponentFiles	
    98 					( 
   181 					( 
    99 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   182 						XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   100 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   183 						XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   101 						const std::vector<ComponentFile>& aComponentFiles 
   184 						const std::vector<ComponentFile>& aComponentFiles 
   116 					);
   199 					);
   117 
   200 
   118 		void AddChildElement(	
   201 		void AddChildElement(	
   119 								XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   202 								XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   120 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   203 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   121 								const wchar_t* aElementName, 
   204 								const XMLCh* aElementName, 
   122 								const wchar_t* aTextValue 
   205 								const XMLCh* aTextValue 
   123 							);
   206 							);
   124 
   207 
   125 		XERCES_CPP_NAMESPACE::DOMElement* AddTag	
   208 		XERCES_CPP_NAMESPACE::DOMElement* AddTag	
   126 							(	
   209 							(	
   127 								XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   210 								XERCES_CPP_NAMESPACE::DOMElement* aRootElement, 
   128 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   211 								XERCES_CPP_NAMESPACE::DOMDocument* aDocument, 
   129 								const wchar_t* aTagName
   212 								const XMLCh* aTagName
   130 							);
   213 							);
   131 
   214 
   132 		void SetWriterFeatures(XERCES_CPP_NAMESPACE::DOMWriter* aDomWriter);
   215 		void SetWriterFeatures(XERCES_CPP_NAMESPACE::DOMWriter* aDomWriter);
   133 
       
   134 	};
   216 	};
   135 
   217 
   136 
   218 
   137 XERCES_CPP_NAMESPACE_BEGIN
   219 XERCES_CPP_NAMESPACE_BEGIN
   138 
   220