OGLplus  (0.59.0) a C++ wrapper for rendering APIs

yes_no_maybe.hpp
Go to the documentation of this file.
1 
9 #ifndef EAGINE_LOGGING_TYPE_YES_NO_MAYBE_HPP
10 #define EAGINE_LOGGING_TYPE_YES_NO_MAYBE_HPP
11 
12 #include "../../tribool.hpp"
13 #include "../entry.hpp"
14 
15 namespace eagine {
16 //------------------------------------------------------------------------------
17 struct yes_no_maybe : tribool {
18  constexpr yes_no_maybe(tribool v) noexcept
19  : tribool{v} {}
20 };
21 //------------------------------------------------------------------------------
22 static inline auto adapt_log_entry_arg(identifier name, yes_no_maybe value) {
23  return [name, value](logger_backend& backend) {
24  backend.add_string(
25  name,
26  EAGINE_ID(YesNoMaybe),
27  value.is(true)
28  ? string_view{"yes"}
29  : value.is(false) ? string_view{"no"} : string_view{"maybe"});
30  };
31 }
32 //------------------------------------------------------------------------------
33 } // namespace eagine
34 
35 #endif // EAGINE_LOGGING_TYPE_YES_NO_MAYBE_HPP
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
#define EAGINE_ID(NAME)
Macro for constructing instances of eagine::identifier.
Definition: identifier.hpp:353
Common code is placed in this namespace.
Definition: eagine.hpp:21
constexpr tribool() noexcept=default
Default constructor.
basic_identifier< 10, 6, default_identifier_char_set, identifier_t > identifier
Default identifier type used throughout the project.
Definition: identifier.hpp:346

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).