Provides a simple on/off switch that controls debugging and tracing output.
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...
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_object.hpp:35
#define core_export_
Define shared library export.
Definition core_export.hpp:13
- Inheritance
- xtd::object → xtd::diagnostics::switch_object → xtd::diagnostics::boolean_switch
- Header
#include <xtd/diagnostics/boolean_switch>
- Namespace
- xtd::diagnostics
- Library
- xtd.core
- Examples
- This example configuration section defines a xtd::diagnostics::boolean_switch with the xtd::diagnostics::boolean_switch::display_name property set to my_switch and the xtd::diagnostics::boolean_switch::enabled value set to true. Within your application, you can use the configured switch value by creating a xtd::diagnostics::boolean_switch with the same name, as shown in the following code example.
private:
public:
static auto main() {
}
}
Represents the standard input, output, and error streams for console applications.
Definition console.hpp:36
static auto write_line() -> void
Writes the current line terminator to the standard output stream using the specified format informati...
Provides a simple on/off switch that controls debugging and tracing output.
Definition boolean_switch.hpp:52
- Note
- If you define #define DEBUG above your includes, debug mode will still be active even if NDEBUG is defined.
- Note
- If you define #define TRACE above your includes, trace mode will still be active even if NTRACE is defined.
- Note
- To improve performance, you can make xtd::diagnostics::boolean_switch members static in your class.
|
| using | attribute_collection |
| | Represents the attributes collection.
|
| auto | attributes () const noexcept -> const attribute_collection & |
| | Gets the custom switch attributes.
|
| auto | attributes () noexcept -> attribute_collection & |
| | Gets the custom switch attributes.
|
| auto | attributes (const attribute_collection &attributes) noexcept -> void |
| | Sets the custom switch attributes.
|
| auto | description () const noexcept -> const xtd::string & |
| | Gets a description of the switch.
|
| auto | display_name () const noexcept -> const xtd::string & |
| | Gets a name used to identify the switch.
|
| auto | value () const noexcept -> const xtd::string & |
| | Gets the value of the switch.
|
| auto | value (const xtd::string &value) -> void |
| | Sets the value of the switch.
|
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| | Determines whether the specified object is equal to the current object.
|
| auto | equals (const switch_object &other) const noexcept -> bool override |
| | Determines whether the specified object is equal to the current object.
|
| | object ()=default |
| | Create a new instance of the ultimate base class object.
|
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| | Serves as a hash function for a particular type.
|
| virtual auto | get_type () const noexcept -> type_object |
| | Gets the type of the current instance.
|
| template<typename object_t> |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| | Creates a shallow copy of the current object.
|
| virtual auto | to_string () const -> xtd::string |
| | Returns a xtd::string that represents the current object.
|
| template<typename object_a_t, typename object_b_t> |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| | Determines whether the specified object instances are considered equal.
|
| template<typename object_a_t, typename object_b_t> |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| | Determines whether the specified object instances are the same instance.
|
| | switch_object (const xtd::string &display_name, const xtd::string &description) |
| | Initializes a new instance of the switch_object class.
|
| auto | switch_setting () const noexcept -> xtd::int32 |
| | Gets the current setting for this switch.
|
| auto | switch_setting (xtd::int32 switch_setting) -> void |
| | Sets the current setting for this switch.
|
| virtual auto | get_supported_attributes () const noexcept -> xtd::array< xtd::string > |
| | Gets the custom attributes supported by the switch.
|
| virtual auto | on_switch_setting_changed () -> void |
| | Invoked when the switch_setting property is changed.
|