From bba8775ce7c63783303240470d4a4b8404c9498b Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sat, 11 Nov 2017 11:36:27 +0000 Subject: Add src file directory structure --- src/main/input-output/command_line_helper.h | 36 +++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/main/input-output/command_line_helper.h (limited to 'src/main/input-output/command_line_helper.h') diff --git a/src/main/input-output/command_line_helper.h b/src/main/input-output/command_line_helper.h new file mode 100644 index 0000000..8cc67cb --- /dev/null +++ b/src/main/input-output/command_line_helper.h @@ -0,0 +1,36 @@ +// +// Created by thecharlesblake on 10/16/17. +// + +#ifndef SOLVITAIRE_COMMAND_LINE_HELPER_H +#define SOLVITAIRE_COMMAND_LINE_HELPER_H + +#include + +class command_line_helper { +public: + command_line_helper(); + bool parse(int argc, const char* argv[]); + const std::vector get_input_files(); + const std::string get_solitaire_type(); + int get_random_deal(); + bool get_help(); +private: + bool assess_errors(); + bool assess_sol_type(); + void print_help(); + void print_no_input_error(); + void print_no_sol_type_error(); + void print_rand_plus_input_err(); + + boost::program_options::options_description cmdline_options; + boost::program_options::options_description main_options; + boost::program_options::positional_options_description p; + + std::vector input_files; + std::string solitaire_type; + int random_deal; + bool help; +}; + +#endif //SOLVITAIRE_COMMAND_LINE_HELPER_H -- cgit v1.2.1 From 34cc6c6d68728d21d49b639f448030a8c2df58c4 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sat, 11 Nov 2017 12:03:35 +0000 Subject: Refactor command line helper --- src/main/input-output/command_line_helper.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/input-output/command_line_helper.h') diff --git a/src/main/input-output/command_line_helper.h b/src/main/input-output/command_line_helper.h index 8cc67cb..9cb772b 100644 --- a/src/main/input-output/command_line_helper.h +++ b/src/main/input-output/command_line_helper.h @@ -15,6 +15,7 @@ public: const std::string get_solitaire_type(); int get_random_deal(); bool get_help(); + private: bool assess_errors(); bool assess_sol_type(); -- cgit v1.2.1 From dc2e84e3ca0ceda7753f1aaec1e648dbde24e9e3 Mon Sep 17 00:00:00 2001 From: thecharlesblake Date: Sun, 12 Nov 2017 10:01:18 +0000 Subject: Tidy up headers for consistency --- src/main/input-output/command_line_helper.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/main/input-output/command_line_helper.h') diff --git a/src/main/input-output/command_line_helper.h b/src/main/input-output/command_line_helper.h index 9cb772b..bb2f698 100644 --- a/src/main/input-output/command_line_helper.h +++ b/src/main/input-output/command_line_helper.h @@ -10,6 +10,7 @@ class command_line_helper { public: command_line_helper(); + bool parse(int argc, const char* argv[]); const std::vector get_input_files(); const std::string get_solitaire_type(); -- cgit v1.2.1