// ApplicationBuilder.h #ifndef dial_ApplicationBuilder_H #define dial_ApplicationBuilder_H // An application builder enables a user to construct an // application from a string. // // The following are attempted until one succeeds: // 1. Parse the input as an XML string. // 2. Parse the input as the name of an XML file. // 3. Extract from the application repository with the string as ID. // 4. Extract from the selection catalog with the string as name. // 5. Construct from files with string as directory name. // // This class manages all the applications that it returns either // directly or using the repository. #include "dial_app/Application.h" class XmlParser; namespace dial { class ApplicationRepository; class ApplicationSelectionCatalog; class ApplicationBuilder { private: // Implementation class class Imp; Imp* m_pimp; public: // methods. // Constructor. ApplicationBuilder(); // Destructor. ~ApplicationBuilder(); // Return the xml parser. XmlParser& parser(); // Return the repository. ApplicationRepository& repository(); // Return the selection catalog. ApplicationSelectionCatalog& selection_catalog(); // Fetch an application. // Returns invalid if the application cannot be found. const Application& get(std::string sapp); }; } // end namespace dial #endif