00001 #pragma once
00002
00003 #include <memory>
00004 #include <string>
00005 #include <vector>
00006
00007 #include <fdr/error.h>
00008
00009 namespace FDR
00010 {
00012 class DisallowedOptionValueError : public Error
00013 {
00014 public:
00015 DisallowedOptionValueError(const std::string& key, const std::string& value);
00016 };
00017
00019 class UnknownOptionError : public Error
00020 {
00021 public:
00022 UnknownOptionError(const std::string& key);
00023 };
00024
00029 class Option
00030 {
00031 public:
00032 virtual ~Option()
00033 {
00034 }
00035
00040 virtual std::vector<std::string> allowed_values() const = 0;
00041
00043 virtual std::string default_value() const = 0;
00044
00046 virtual std::string get() const = 0;
00047
00049 virtual std::string description() const = 0;
00050
00052 virtual std::string name() const = 0;
00053
00060 virtual void set(const std::string& new_value) = 0;
00061
00063 static const std::vector<std::shared_ptr<Option>>& options();
00064
00068 static const std::shared_ptr<Option>& get_option(const std::string& option_name);
00069 };
00070
00071 }