blob: d272eb3fd00fd828ed5477e8b81b9066078d9c0d [file] [log] [blame]
#pragma once
#include <array>
#include <cstdint>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include <android/binder_enums.h>
#ifdef BINDER_STABILITY_SUPPORT
#include <android/binder_stability.h>
#endif // BINDER_STABILITY_SUPPORT
namespace aidl {
namespace android {
namespace aidl {
namespace tests {
enum class IntEnum : int32_t {
FOO = 1000,
BAR = 2000,
BAZ = 2001,
QUX __attribute__((deprecated("do not use this"))) = 2002,
};
} // namespace tests
} // namespace aidl
} // namespace android
} // namespace aidl
namespace aidl {
namespace android {
namespace aidl {
namespace tests {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
[[nodiscard]] static inline std::string toString(IntEnum val) {
switch(val) {
case IntEnum::FOO:
return "FOO";
case IntEnum::BAR:
return "BAR";
case IntEnum::BAZ:
return "BAZ";
case IntEnum::QUX:
return "QUX";
default:
return std::to_string(static_cast<int32_t>(val));
}
}
#pragma clang diagnostic pop
} // namespace tests
} // namespace aidl
} // namespace android
} // namespace aidl
namespace ndk {
namespace internal {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wc++17-extensions"
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
template <>
constexpr inline std::array<aidl::android::aidl::tests::IntEnum, 4> enum_values<aidl::android::aidl::tests::IntEnum> = {
aidl::android::aidl::tests::IntEnum::FOO,
aidl::android::aidl::tests::IntEnum::BAR,
aidl::android::aidl::tests::IntEnum::BAZ,
aidl::android::aidl::tests::IntEnum::QUX,
};
#pragma clang diagnostic pop
} // namespace internal
} // namespace ndk