From 2f14c18ff51356c93b2f0b2aeecc84de6398cc0a Mon Sep 17 00:00:00 2001 From: Jan Sucan Date: Mon, 27 Jan 2025 10:46:40 +0100 Subject: Remove use of inheritance for Options classes --- src/options.h | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) (limited to 'src/options.h') diff --git a/src/options.h b/src/options.h index ec1906b..f30f253 100644 --- a/src/options.h +++ b/src/options.h @@ -37,50 +37,40 @@ class OptionError : public DiffddError explicit OptionError(const std::string &message) : DiffddError(message) {} }; -class Options -{ - friend class OptionParser; - - public: - static const int DEFAULT_BUFFER_SIZE{4 * 1024 * 1024}; +const inline int OPTIONS_DEFAULT_BUFFER_SIZE{4 * 1024 * 1024}; - Options(); - virtual ~Options() = default; - - uint32_t getBufferSize() const; - - private: - uint32_t buffer_size; -}; - -class OptionsCreate : public Options +class OptionsCreate { friend class OptionParser; public: - virtual ~OptionsCreate() override = default; + OptionsCreate(); + uint32_t getBufferSize() const; std::filesystem::path getInFilePath() const; std::filesystem::path getBaseFilePath() const; std::filesystem::path getOutFilePath() const; private: + uint32_t buffer_size; std::filesystem::path in_file_path; std::filesystem::path base_file_path; std::filesystem::path out_file_path; }; -class OptionsRestore : public Options +class OptionsRestore { friend class OptionParser; public: - virtual ~OptionsRestore() override = default; + OptionsRestore(); + uint32_t getBufferSize() const; std::filesystem::path getDiffFilePath() const; std::filesystem::path getOutFilePath() const; private: + uint32_t buffer_size; std::filesystem::path diff_file_path; std::filesystem::path out_file_path; }; -- cgit v1.2.3