Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

XMLComponentManagerReader.h

Go to the documentation of this file.
00001 
00033 #ifndef _AMIRE_PERSISTENCE_XML_COMPONENT_MANAGER_READER_H
00034 #define _AMIRE_PERSISTENCE_XML_COMPONENT_MANAGER_READER_H
00035 
00036 #include <xercesc/util/PlatformUtils.hpp>
00037 
00038 #include <xercesc/sax/HandlerBase.hpp>
00039 #include <xercesc/sax2/SAX2XMLReader.hpp>
00040 #include <xercesc/util/XMLString.hpp>
00041 
00042 #include <math.h>
00043 #include <string.h>
00044 #include <string>
00045 #include <stdlib.h>
00046 #include <stdio.h>
00047 
00048 
00049 #include <amire/common/DllSupport.h>
00050 #include <amire/component/ComponentManager.h>
00051 #include <amire/component/ComponentManagerReader.h>
00052 
00053 namespace amire {
00054   namespace persistence {
00059     class AMIRE_EXPORT_API XMLComponentManagerReader : public amire::component::ComponentManagerReader  {
00060     private: 
00061       std::string fileName;       
00062       std::vector <std::string> preparsedSchemas;
00063       std::string currentLibraryName;
00064       std::string libraryPathVariable;
00065       SAX2XMLReader* parser;   
00066       amire::component::ComponentManager * manager;
00067     public:
00068       XMLComponentManagerReader::XMLComponentManagerReader(const std::string & aFileName, amire::component::ComponentManager * aManager = NULL);
00069       virtual ~XMLComponentManagerReader();            
00070           
00076       virtual amire::component::ComponentManager *read();   
00077       
00078       
00079       void setFileName(const std::string &aFileName) {
00080         fileName = aFileName;
00081       }
00082       
00083       
00084       void setComponentManager(amire::component::ComponentManager * aManager) {
00085         manager = aManager;
00086       }
00087       
00088       void setCurrentLibraryName(std::string aCurrentLibraryName) {
00089         currentLibraryName = aCurrentLibraryName;
00090       }
00091       
00092       void setLibraryPathVariable (std::string aLibraryPathVariable) {
00093         libraryPathVariable = aLibraryPathVariable;
00094       }
00095       const std::string &getFileName() const {
00096         return fileName;
00097       }
00098       
00099                  
00100       void parseSchema(const std::string aSchemaURI); 
00101          
00102          
00103     protected:
00104       XMLComponentManagerReader();
00105       void readPropertyTypes(amire::component::ComponentManager * aComponentManager);
00106       void readComponentPrototypes(amire::component::ComponentManager * aComponentManager);
00107       void readApplication(amire::component::ComponentManager * aComponentManager);                    
00108     private: 
00109       void initXMLEnvironment();
00110       void initParser();
00111       void terminateXMLEnvironment();
00112     };
00113   }
00114 }
00115 
00116 #endif

Generated on Tue May 20 17:23:54 2003 for AMIRE-Framework by doxygen1.3