42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
|
//
|
||
|
// Created by bbr on 27.05.22..
|
||
|
//
|
||
|
|
||
|
#ifndef SCHEMEEDITOR_APPLICATION_H
|
||
|
#define SCHEMEEDITOR_APPLICATION_H
|
||
|
|
||
|
|
||
|
#include "comdel/domain/library.h"
|
||
|
#include "comdel/domain/schema.h"
|
||
|
#include "comdel/domain/comdel_validator.h"
|
||
|
|
||
|
|
||
|
class Application {
|
||
|
private:
|
||
|
std::string libraryPath;
|
||
|
std::optional<domain::Library> library = std::nullopt;
|
||
|
domain::Schema* schema = nullptr;
|
||
|
public:
|
||
|
std::optional<domain::Library> getLibrary();
|
||
|
domain::Schema* getSchema();
|
||
|
std::vector<domain::FunctionValidator*> validators = domain::getSupportedValidators();
|
||
|
|
||
|
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<domain::ValidationError> validateSchema();
|
||
|
std::vector<domain::ValidationError> generateComdel(std::ostringstream &output);
|
||
|
|
||
|
static bool hasErrors(std::vector<domain::ValidationError> empty);
|
||
|
|
||
|
~Application() = default;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //SCHEMEEDITOR_APPLICATION_H
|