xtd - Reference Guide 0.2.0
boolean_switch.h
Go to the documentation of this file.
1 #pragma once
5 #include <optional>
6 #include "switch_base.h"
7 
9 namespace xtd {
11  namespace diagnostics {
46  class core_export_ boolean_switch : public xtd::diagnostics::switch_base {
47  public:
50 
76  boolean_switch(const xtd::ustring& display_name, const xtd::ustring& description);
82  boolean_switch(const xtd::ustring& display_name, const xtd::ustring& description, const xtd::ustring& default_switch_value);
83 
85 
88 
92  bool enabled() const;
96  void enabled(bool enabled);
97 
99 
100  protected:
103 
106  void on_value_changed() override;
107 
109 
110  private:
111  mutable std::optional<bool> enabled_;
112  };
113  }
114 }
115 
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:50
Provides a simple on/off switch that controls debugging and tracing output.
Definition: boolean_switch.h:46
Contains xtd::diagnostics::switch_base class.
Provides an abstract base class to create new debugging and tracing switches.
Definition: switch_base.h:31