diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-22 19:24:27 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-22 19:29:28 +0200 |
| commit | fe12cdce3fa13d490852e7f389015a1958a6f2c6 (patch) | |
| tree | 0802935a5fd6f494cc57d66c8a7282185267c12d /aesxx/utils/helpers | |
| parent | aesxx/utils: more refactoring (diff) | |
| download | aes-tools-fe12cdce3fa13d490852e7f389015a1958a6f2c6.tar.gz aes-tools-fe12cdce3fa13d490852e7f389015a1958a6f2c6.zip | |
aesxx/utils: some more basic refactoring
Diffstat (limited to 'aesxx/utils/helpers')
| -rw-r--r-- | aesxx/utils/helpers/cmd_parser.hpp | 8 | ||||
| -rw-r--r-- | aesxx/utils/helpers/cmd_parser_file.hpp | 42 |
2 files changed, 40 insertions, 10 deletions
diff --git a/aesxx/utils/helpers/cmd_parser.hpp b/aesxx/utils/helpers/cmd_parser.hpp index 607253c..11146e8 100644 --- a/aesxx/utils/helpers/cmd_parser.hpp +++ b/aesxx/utils/helpers/cmd_parser.hpp @@ -39,12 +39,14 @@ public: vm ); if (vm.count("help")) - exit_with_usage = true; + _exit_with_usage = true; else boost::program_options::notify(vm); } - bool exit_with_usage = false; + bool exit_with_usage() const { + return _exit_with_usage; + } void usage() const { std::cout << *this; @@ -73,4 +75,6 @@ private: os << parser.visible; return os; } + + bool _exit_with_usage = false; }; diff --git a/aesxx/utils/helpers/cmd_parser_file.hpp b/aesxx/utils/helpers/cmd_parser_file.hpp index fd6072a..81562f5 100644 --- a/aesxx/utils/helpers/cmd_parser_file.hpp +++ b/aesxx/utils/helpers/cmd_parser_file.hpp @@ -19,14 +19,6 @@ class FileSettings : public SettingsParser { public: - aes::Algorithm algorithm = AES_AES128; - aes::Mode mode = AES_ECB; - - std::string input_path; - std::string output_path; - std::string key; - std::string iv; - explicit FileSettings(std::string_view argv0) : SettingsParser{argv0} { visible.add_options()( "algorithm,a", @@ -79,4 +71,38 @@ public: }; } } + + aes::Algorithm get_algorithm() const { + return algorithm; + } + + aes::Mode get_mode() const { + return mode; + } + + std::string get_input_path() const { + return input_path; + } + + std::string get_output_path() const { + return output_path; + } + + std::string get_key() const { + return key; + } + + std::string get_iv() const { + return iv; + } + +private: + aes::Algorithm algorithm; + aes::Mode mode; + + std::string input_path; + std::string output_path; + + std::string key; + std::string iv; }; |
