xtd 0.2.0
boolean_switch.h
Go to the documentation of this file.
1 #pragma once
5 #include "../optional.h"
6 #include "switch_base.h"
7 
9 namespace xtd {
11  namespace diagnostics {
48  class core_export_ boolean_switch : public xtd::diagnostics::switch_base {
49  public:
52 
78  boolean_switch(const xtd::ustring& display_name, const xtd::ustring& description);
84  boolean_switch(const xtd::ustring& display_name, const xtd::ustring& description, const xtd::ustring& default_switch_value);
85 
87 
90 
94  bool enabled() const;
98  void enabled(bool enabled);
99 
101 
102  protected:
105 
108  void on_value_changed() override;
109 
111 
112  private:
113  mutable std::optional<bool> enabled_;
114  };
115  }
116 }
117 
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Provides a simple on/off switch that controls debugging and tracing output.
Definition: boolean_switch.h:48
Contains xtd::diagnostics::switch_base class.
Provides an abstract base class to create new debugging and tracing switches.
Definition: switch_base.h:34