xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
boolean_switch.h
Go to the documentation of this file.
1
4#pragma once
5#include <optional>
6#include "switch_base.h"
7
9namespace xtd {
11 namespace diagnostics {
42 public:
74 boolean_switch(const xtd::ustring& display_name, const xtd::ustring& description, const xtd::ustring& default_switch_value);
75
79 bool enabled() const;
83 void enabled(bool enabled);
84
85 protected:
88 void on_value_changed() override;
89
90 private:
91 mutable std::optional<bool> enabled_;
92 };
93 }
94}
95
Provides a simple on/off switch that controls debugging and tracing output.
Definition: boolean_switch.h:41
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::ustring &display_name, const xtd::ustring &description)
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.
boolean_switch(const xtd::ustring &display_name, const xtd::ustring &description, const xtd::ustring &default_switch_value)
Initializes a new instance of the xtd::diagnostics::boolean_switch class with the specified display n...
Provides an abstract base class to create new debugging and tracing switches.
Definition: switch_base.h:26
const xtd::ustring & display_name() const
Gets a name used to identify the switch.
const xtd::ustring & description() const
Gets a description of the switch.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::diagnostics::switch_base class.