#ifndef option_hh_INCLUDED #define option_hh_INCLUDED #include "enum.hh" #include "meta.hh" namespace Kakoune { class String; // Forward declare functions that wont get found by ADL inline String option_to_string(int opt); inline String option_to_string(size_t opt); inline String option_to_string(bool opt); template struct PrefixedList { P prefix; Vector list; friend bool operator==(const PrefixedList& lhs, const PrefixedList& rhs) { return lhs.prefix == rhs.prefix and lhs.list == rhs.list; } friend bool operator!=(const PrefixedList& lhs, const PrefixedList& rhs) { return not (lhs == rhs); } }; template using TimestampedList = PrefixedList; enum class DebugFlags { None = 0, Hooks = 1 << 0, Shell = 1 << 1, Profile = 1 << 2, Keys = 1 << 3, Commands = 1 << 4, }; constexpr bool with_bit_ops(Meta::Type) { return true; } constexpr Array, 5> enum_desc(Meta::Type) { return { { { DebugFlags::Hooks, "hooks" }, { DebugFlags::Shell, "shell" }, { DebugFlags::Profile, "profile" }, { DebugFlags::Keys, "keys" }, { DebugFlags::Commands, "commands" }, } }; } } #endif // option_hh_INCLUDED