// // Created by bbr on 27.05.22.. // #ifndef SCHEMEEDITOR_APPLICATION_H #define SCHEMEEDITOR_APPLICATION_H #include #include "comdel/domain/library.h" #include "comdel/domain/schema.h" #include "comdel/domain/comdel_validator.h" class Application { private: std::string libraryPath; std::optional library = std::nullopt; domain::Schema* schema = nullptr; std::vector validators = domain::getSupportedValidators(); std::string generateName(std::set& names, std::string instanceName); public: std::optional getLibrary(); domain::Schema* getSchema(); void clear(); bool loadLibrary(std::string& filename, std::ostream& errorOutput); bool loadSchema(std::string& filename, std::ostream& errorOutput); static Application* instance(); bool generateSchema(std::ostringstream &output); std::vector validateSchema(); std::vector generateComdel(std::ostringstream &output); std::shared_ptr addComponent(domain::Component component, std::vector attributes, int x, int y); std::shared_ptr addBus(domain::Bus bus, int x, int y); static bool hasErrors(std::vector empty); ~Application() = default; }; #endif //SCHEMEEDITOR_APPLICATION_H