type operator()() const;
bool wasSetByUser() const;
void set(const type& v);
+ const char* getName() const;
}} {name} CVC4_PUBLIC;"""
TPL_OPTION_STRUCT_RO = \
typedef {type} type;
type operator()() const;
bool wasSetByUser() const;
+ const char* getName() const;
}} {name} CVC4_PUBLIC;"""
return d_holder->{name}__setByUser__;
}}"""
-
# Option specific methods
TPL_IMPL_OPTION_SET = \
return Options::current()->wasSetByUser(*this);
}}"""
+TPL_IMPL_GET_NAME = \
+"""inline const char* {name}__option_t::getName() const
+{{
+ return "{long_name}";
+}}"""
+
+
+
# Mode templates
TPL_DECL_MODE_ENUM = \
"""
inls.append(TPL_IMPL_OPTION_WAS_SET_BY_USER.format(name=option.name))
if not option.read_only:
inls.append(TPL_IMPL_OPTION_SET.format(name=option.name))
+ if option.long:
+ long_name = option.long.split('=')[0]
+ else:
+ long_name = ""
+ inls.append(TPL_IMPL_GET_NAME.format(
+ name=option.name, long_name=long_name))
### Generate code for {module.name}_options.cpp