tri_state.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Copyright 2015 The Crashpad Authors. All rights reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef CRASHPAD_UTIL_MISC_TRI_STATE_H_
  15. #define CRASHPAD_UTIL_MISC_TRI_STATE_H_
  16. #include <stdint.h>
  17. namespace crashpad {
  18. //! \brief A tri-state value that can be unset, on, or off.
  19. enum class TriState : uint8_t {
  20. //! \brief The value has not explicitly been set.
  21. //!
  22. //! To allow a zero-initialized value to have this behavior, this must have
  23. //! the value `0`.
  24. kUnset = 0,
  25. //! \brief The value has explicitly been set to on, or a behavior has
  26. //! explicitly been enabled.
  27. kEnabled,
  28. //! \brief The value has explicitly been set to off, or a behavior has
  29. //! explicitly been disabled.
  30. kDisabled,
  31. };
  32. } // namespace crashpad
  33. #endif // CRASHPAD_UTIL_MISC_TRI_STATE_H_