From 17d180891f1e237ea5d25835999a8b23a6e7946d Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Sat, 11 Jun 2016 20:17:35 +0300 Subject: rename dirs --- kms++util/opts.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 kms++util/opts.h (limited to 'kms++util/opts.h') diff --git a/kms++util/opts.h b/kms++util/opts.h new file mode 100644 index 0000000..1b0fd22 --- /dev/null +++ b/kms++util/opts.h @@ -0,0 +1,38 @@ +#pragma once + +#include +#include +#include + +class Option +{ + friend class OptionSet; +public: + Option(const std::string& str, std::function func); + Option(const std::string& str, std::function func); + +private: + void parse(const std::string& str); + + char m_short; + std::string m_long; + int m_has_arg; + std::function m_void_func; + std::function m_func; +}; + +class OptionSet +{ +public: + OptionSet(std::initializer_list