2222
2323module ;
2424
25+ #include < essence/compat.hpp>
26+
2527export module essence.cli:abstract.option;
2628import :common_types;
2729import :validation_result;
@@ -40,77 +42,77 @@ export namespace essence::cli::abstract {
4042 requires (!std::same_as<std::decay_t <T>, option>)
4143 explicit option (T&& value) : wrapper_{std::make_shared<wrapper<T>>(std::forward<T>(value))} {}
4244
43- [[nodiscard]] abi::string bound_name () const {
45+ ES_API (CPPESSENCE) [[nodiscard]] abi::string bound_name () const {
4446 return wrapper_->bound_name ();
4547 }
4648
47- const option& set_bound_name (std::string_view name) const { // NOLINT(*-use-nodiscard)
49+ ES_API (CPPESSENCE) const option& set_bound_name (std::string_view name) const { // NOLINT(*-use-nodiscard)
4850 wrapper_->set_bound_name (name);
4951
5052 return *this ;
5153 }
5254
53- [[nodiscard]] abi::string description () const {
55+ ES_API (CPPESSENCE) [[nodiscard]] abi::string description () const {
5456 return wrapper_->description ();
5557 }
5658
57- [[nodiscard]] const option& set_description (std::string_view description) const {
59+ ES_API (CPPESSENCE) [[nodiscard]] const option& set_description (std::string_view description) const {
5860 wrapper_->set_description (description);
5961
6062 return *this ;
6163 }
6264
63- [[nodiscard]] std::span<const abi::string> aliases () const {
65+ ES_API (CPPESSENCE) [[nodiscard]] std::span<const abi::string> aliases () const {
6466 return wrapper_->aliases ();
6567 }
6668
67- const option& add_aliases (std::span<const abi::string> aliases) const { // NOLINT(*-use-nodiscard)
69+ ES_API (CPPESSENCE) const option& add_aliases (std::span<const abi::string> aliases) const { // NOLINT(*-use-nodiscard)
6870 wrapper_->add_aliases (aliases);
6971
7072 return *this ;
7173 }
7274
73- [[nodiscard]] std::optional<abi::string> default_value_str () const {
75+ ES_API (CPPESSENCE) [[nodiscard]] std::optional<abi::string> default_value_str () const {
7476 return wrapper_->default_value_str ();
7577 }
7678
77- [[nodiscard]] std::span<const abi::string> valid_value_strs () const {
79+ ES_API (CPPESSENCE) [[nodiscard]] std::span<const abi::string> valid_value_strs () const {
7880 return wrapper_->valid_value_strs ();
7981 }
8082
81- [[nodiscard]] abi::string name_hints () const {
83+ ES_API (CPPESSENCE) [[nodiscard]] abi::string name_hints () const {
8284 return wrapper_->name_hints ();
8385 }
8486
85- [[nodiscard]] abi::string value_hints () const {
87+ ES_API (CPPESSENCE) [[nodiscard]] abi::string value_hints () const {
8688 return wrapper_->value_hints ();
8789 }
8890
89- [[nodiscard]] bool check_target_type (meta::fingerprint id) const {
91+ ES_API (CPPESSENCE) [[nodiscard]] bool check_target_type (meta::fingerprint id) const {
9092 return wrapper_->check_target_type (id);
9193 }
9294
93- [[nodiscard]] bool parse_value_and_cache (std::string_view value) const {
95+ ES_API (CPPESSENCE) [[nodiscard]] bool parse_value_and_cache (std::string_view value) const {
9496 return wrapper_->parse_value_and_cache (value);
9597 }
9698
97- void validate (std::string_view value, validation_result& result) const {
99+ ES_API (CPPESSENCE) void validate (std::string_view value, validation_result& result) const {
98100 wrapper_->validate (value, result);
99101 }
100102
101- void raise_error (std::string_view message) const {
103+ ES_API (CPPESSENCE) void raise_error (std::string_view message) const {
102104 wrapper_->raise_error (message);
103105 }
104106
105- [[nodiscard]] void * underlying_ptr () const noexcept {
107+ ES_API (CPPESSENCE) [[nodiscard]] void * underlying_ptr () const noexcept {
106108 return wrapper_.get ();
107109 }
108110
109- void on_validation (const validation_handler& handler) const {
111+ ES_API (CPPESSENCE) void on_validation (const validation_handler& handler) const {
110112 wrapper_->on_validation (handler);
111113 }
112114
113- void on_error (const output_handler& handler) const {
115+ ES_API (CPPESSENCE) void on_error (const output_handler& handler) const {
114116 wrapper_->on_error (handler);
115117 }
116118
0 commit comments