xtd 0.2.0
Loading...
Searching...
No Matches
boolean_switch.h
Go to the documentation of this file.
1
4#pragma once
5#include "../optional.h"
6#include "switch_base.h"
7
9namespace xtd {
11 namespace diagnostics {
51 public:
54
80 boolean_switch(const xtd::string& display_name, const xtd::string& description);
86 boolean_switch(const xtd::string& display_name, const xtd::string& description, const xtd::string& default_switch_value);
87
89
92
96 bool enabled() const;
100 void enabled(bool enabled);
101
103
104 protected:
107
110 void on_value_changed() override;
111
113
114 private:
115 mutable std::optional<bool> enabled_;
116 };
117 }
118}
119
Represents text as a sequence of character units.
Definition basic_string.h:79
Provides a simple on/off switch that controls debugging and tracing output.
Definition boolean_switch.h:50
void on_value_changed() override
Determines whether the new value of the Value property can be parsed as a Boolean value.
boolean_switch(const xtd::string &display_name, const xtd::string &description)
Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display n...
boolean_switch(const xtd::string &display_name, const xtd::string &description, const xtd::string &default_switch_value)
Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display n...
void enabled(bool enabled)
Sets a value indicating whether the switch is enabled or disabled.
bool enabled() const
Gets a value indicating whether the switch is enabled or disabled.
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_base.h:36
#define core_export_
Define shared library export.
Definition core_export.h:13
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::diagnostics::switch_base class.