diff --git a/tools/matc/src/main.cpp b/tools/matc/src/main.cpp index 7455869fa4..ef1a14d75e 100644 --- a/tools/matc/src/main.cpp +++ b/tools/matc/src/main.cpp @@ -14,29 +14,25 @@ * limitations under the License. */ -#include - -#include -#include - -#include "matc/Compiler.h" #include "matc/CommandlineConfig.h" #include "matc/MaterialCompiler.h" +#include + +#include + using namespace matc; int main(int argc, char** argv) { - CommandlineConfig parameters(argc, argv); - if (!parameters.isValid()) { + CommandlineConfig config(argc, argv); + if (!config.isValid()) { std::cerr << "Invalid parameters." << std::endl; return EXIT_FAILURE; } - const std::unique_ptr compiler = std::make_unique(); - - if (!compiler->start(parameters)) { + MaterialCompiler compiler; + if (!compiler.compile(config)) { return EXIT_FAILURE; } - return EXIT_SUCCESS; } diff --git a/tools/matc/src/matc/CommandlineConfig.h b/tools/matc/src/matc/CommandlineConfig.h index c8ef6b788e..88601c3914 100644 --- a/tools/matc/src/matc/CommandlineConfig.h +++ b/tools/matc/src/matc/CommandlineConfig.h @@ -30,7 +30,7 @@ public: explicit FilesystemOutput(const char* path) : mPath(path) { } - virtual ~FilesystemOutput() {} + ~FilesystemOutput() override = default; bool open() noexcept override { mFile.open(mPath.c_str(), std::ofstream::out | std::ofstream::binary); @@ -60,7 +60,7 @@ public: explicit FilesystemInput(const char* path) : mPath(path) { } - virtual ~FilesystemInput() {} + ~FilesystemInput() override = default; ssize_t open() noexcept override { mFile.open(mPath.c_str(), std::ifstream::binary | std::ios::ate); @@ -101,7 +101,7 @@ class CommandlineConfig : public Config { public: CommandlineConfig(int argc, char** argv); - virtual ~CommandlineConfig() { + ~CommandlineConfig() override { delete mInput; delete mOutput; }; diff --git a/tools/matc/src/matc/Compiler.h b/tools/matc/src/matc/Compiler.h index 23b178a4a9..4a69e7eff5 100644 --- a/tools/matc/src/matc/Compiler.h +++ b/tools/matc/src/matc/Compiler.h @@ -25,9 +25,9 @@ namespace matc { class Compiler { public: - virtual ~Compiler() {} + virtual ~Compiler() = default; - bool start(const Config& config) { + bool compile(const Config& config) { if (!checkParameters(config)) { return false; }