2 #include "../icedb/defs.h" 6 #include "../icedb/optionsForwards.hpp" 10 class options :
public std::enable_shared_from_this<options>
14 std::shared_ptr<options_inner>
p;
17 static std::shared_ptr<options>
generate();
18 void enumVals(std::ostream &out)
const;
19 bool hasVal(
const std::string &key)
const;
21 template <
class T> T
getVal(
const std::string &key)
const;
23 template <
class T> T
getVal(
const std::string &key,
const T& defaultval)
const;
27 template <
class T>
options_ptr add(
const std::string &key,
const T &value);
30 inline void filename(
const std::string& val) { setVal<std::string>(
"filename", val); }
31 inline std::string
filename()
const {
return getVal<std::string>(
"filename",
""); }
32 inline void extension(
const std::string& val) { setVal<std::string>(
"extension", val); }
33 inline std::string
extension()
const {
return getVal<std::string>(
"extension",
""); }
34 inline void filetype(
const std::string &val) { setVal<std::string>(
"filetype", val); }
35 inline std::string
filetype()
const {
return getVal<std::string>(
"filetype",
""); }
36 inline void exportType(
const std::string &val) { setVal<std::string>(
"exportType", val); }
37 inline std::string
exportType()
const {
return getVal<std::string>(
"exportType",
""); }
void enumVals(std::ostream &out) const
void exportType(const std::string &val)
std::string exportType() const
options_ptr setVal(const std::string &key, const T &value)
Adds or replaces an option.
bool hasVal(const std::string &key) const
static std::shared_ptr< options > generate()
T getVal(const std::string &key) const
Retrieves an option. Throws if nonexistant.
std::string filetype() const
std::string extension() const
options_ptr add(const std::string &key, const T &value)
Adds an option. Throws if the same name already exists.
std::shared_ptr< options_inner > p
void extension(const std::string &val)
std::shared_ptr< options > options_ptr
std::string filename() const
void filetype(const std::string &val)
void filename(const std::string &val)