diff options
| author | Jan Sucan <jan@jansucan.com> | 2025-01-27 10:46:40 +0100 |
|---|---|---|
| committer | Ján Sučan <jan@jansucan.com> | 2025-01-27 15:22:36 +0100 |
| commit | 2f14c18ff51356c93b2f0b2aeecc84de6398cc0a (patch) | |
| tree | f12f40a34ea8b8747db86b0005a1b8316e4eedfe /src/options.h | |
| parent | 1cf9fb80b56d40596a7239c567bcd2aab2458ba5 (diff) | |
Remove use of inheritance for Options classes
Diffstat (limited to 'src/options.h')
| -rw-r--r-- | src/options.h | 28 |
1 files changed, 9 insertions, 19 deletions
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; }; |
