From eb867ec9baaabc5b60816861923fdef53972cba2 Mon Sep 17 00:00:00 2001 From: neargye Date: Sun, 12 Nov 2023 01:11:55 +0400 Subject: [PATCH] put headers in include/magic_enum directory --- BUILD.bazel | 2 +- CMakeLists.txt | 4 ++-- MODULE.bazel | 2 +- include/{ => magic_enum}/magic_enum.hpp | 11 ++++++----- include/{ => magic_enum}/magic_enum_all.hpp | 2 +- include/{ => magic_enum}/magic_enum_containers.hpp | 2 +- include/{ => magic_enum}/magic_enum_flags.hpp | 2 +- include/{ => magic_enum}/magic_enum_format.hpp | 2 +- include/{ => magic_enum}/magic_enum_fuse.hpp | 2 +- include/{ => magic_enum}/magic_enum_iostream.hpp | 2 +- include/{ => magic_enum}/magic_enum_switch.hpp | 2 +- include/{ => magic_enum}/magic_enum_utility.hpp | 2 +- meson.build | 2 +- package.xml | 2 +- 14 files changed, 20 insertions(+), 19 deletions(-) rename include/{ => magic_enum}/magic_enum.hpp (99%) rename include/{ => magic_enum}/magic_enum_all.hpp (98%) rename include/{ => magic_enum}/magic_enum_containers.hpp (99%) rename include/{ => magic_enum}/magic_enum_flags.hpp (99%) rename include/{ => magic_enum}/magic_enum_format.hpp (99%) rename include/{ => magic_enum}/magic_enum_fuse.hpp (99%) rename include/{ => magic_enum}/magic_enum_iostream.hpp (99%) rename include/{ => magic_enum}/magic_enum_switch.hpp (99%) rename include/{ => magic_enum}/magic_enum_utility.hpp (99%) diff --git a/BUILD.bazel b/BUILD.bazel index a9d3f1a..53d6d84 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -9,7 +9,7 @@ package(default_visibility = ["//visibility:public"]) cc_library( name = "magic_enum", - hdrs = glob(["include/*.hpp"]), + hdrs = glob(["include/magic_enum/*.hpp"]), copts = COPTS, includes = ["include"], ) diff --git a/CMakeLists.txt b/CMakeLists.txt index 73d8618..e106a3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.14) project(magic_enum - VERSION "0.9.3" + VERSION "0.9.4" HOMEPAGE_URL "https://github.com/Neargye/magic_enum" DESCRIPTION "A library that provides static reflection for enums, work with any enum type without any macro or boilerplate code." LANGUAGES CXX @@ -32,7 +32,7 @@ if(MAGIC_ENUM_OPT_BUILD_TESTS) add_subdirectory(test) endif() -set(INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include") +set(INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include/magic_enum") set(EXPORT_NAMESPACE "${PROJECT_NAME}::") add_library(${PROJECT_NAME} INTERFACE) diff --git a/MODULE.bazel b/MODULE.bazel index 39c6bbc..c696344 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -1,6 +1,6 @@ module( name = "magic_enum", - version = "0.9.3", + version = "0.9.4", compatibility_level = 0, ) diff --git a/include/magic_enum.hpp b/include/magic_enum/magic_enum.hpp similarity index 99% rename from include/magic_enum.hpp rename to include/magic_enum/magic_enum.hpp index 0760ff4..7423286 100644 --- a/include/magic_enum.hpp +++ b/include/magic_enum/magic_enum.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT @@ -34,7 +34,7 @@ #define MAGIC_ENUM_VERSION_MAJOR 0 #define MAGIC_ENUM_VERSION_MINOR 9 -#define MAGIC_ENUM_VERSION_PATCH 3 +#define MAGIC_ENUM_VERSION_PATCH 4 #include #include @@ -829,8 +829,8 @@ inline constexpr auto max_v = (count_v > 0) ? static_cast(values_v constexpr auto names(std::index_sequence) noexcept { - constexpr auto result = std::array{{enum_name_v[I]>...}}; - return result; + constexpr auto names = std::array{{enum_name_v[I]>...}}; + return names; } template @@ -841,7 +841,8 @@ using names_t = decltype((names_v)); template constexpr auto entries(std::index_sequence) noexcept { - return std::array, sizeof...(I)>{{{values_v[I], enum_name_v[I]>}...}}; + constexpr auto entries = std::array, sizeof...(I)>{{{values_v[I], enum_name_v[I]>}...}}; + return entries; } template diff --git a/include/magic_enum_all.hpp b/include/magic_enum/magic_enum_all.hpp similarity index 98% rename from include/magic_enum_all.hpp rename to include/magic_enum/magic_enum_all.hpp index c34dad3..5cc6d4b 100644 --- a/include/magic_enum_all.hpp +++ b/include/magic_enum/magic_enum_all.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_containers.hpp b/include/magic_enum/magic_enum_containers.hpp similarity index 99% rename from include/magic_enum_containers.hpp rename to include/magic_enum/magic_enum_containers.hpp index 5d72c60..e2a8737 100644 --- a/include/magic_enum_containers.hpp +++ b/include/magic_enum/magic_enum_containers.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_flags.hpp b/include/magic_enum/magic_enum_flags.hpp similarity index 99% rename from include/magic_enum_flags.hpp rename to include/magic_enum/magic_enum_flags.hpp index a45ed78..880484e 100644 --- a/include/magic_enum_flags.hpp +++ b/include/magic_enum/magic_enum_flags.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_format.hpp b/include/magic_enum/magic_enum_format.hpp similarity index 99% rename from include/magic_enum_format.hpp rename to include/magic_enum/magic_enum_format.hpp index 03f3e44..d81b151 100644 --- a/include/magic_enum_format.hpp +++ b/include/magic_enum/magic_enum_format.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_fuse.hpp b/include/magic_enum/magic_enum_fuse.hpp similarity index 99% rename from include/magic_enum_fuse.hpp rename to include/magic_enum/magic_enum_fuse.hpp index 8773404..ce8e68e 100644 --- a/include/magic_enum_fuse.hpp +++ b/include/magic_enum/magic_enum_fuse.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_iostream.hpp b/include/magic_enum/magic_enum_iostream.hpp similarity index 99% rename from include/magic_enum_iostream.hpp rename to include/magic_enum/magic_enum_iostream.hpp index d2907bf..bb11a04 100644 --- a/include/magic_enum_iostream.hpp +++ b/include/magic_enum/magic_enum_iostream.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_switch.hpp b/include/magic_enum/magic_enum_switch.hpp similarity index 99% rename from include/magic_enum_switch.hpp rename to include/magic_enum/magic_enum_switch.hpp index 1cae014..465e5b6 100644 --- a/include/magic_enum_switch.hpp +++ b/include/magic_enum/magic_enum_switch.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/include/magic_enum_utility.hpp b/include/magic_enum/magic_enum_utility.hpp similarity index 99% rename from include/magic_enum_utility.hpp rename to include/magic_enum/magic_enum_utility.hpp index 20dda97..12e7010 100644 --- a/include/magic_enum_utility.hpp +++ b/include/magic_enum/magic_enum_utility.hpp @@ -5,7 +5,7 @@ // | | | | (_| | (_| | | (__ | |____| | | | |_| | | | | | | | |____|_| |_| // |_| |_|\__,_|\__, |_|\___| |______|_| |_|\__,_|_| |_| |_| \_____| // __/ | https://github.com/Neargye/magic_enum -// |___/ version 0.9.3 +// |___/ version 0.9.4 // // Licensed under the MIT License . // SPDX-License-Identifier: MIT diff --git a/meson.build b/meson.build index 8189fa3..64a3913 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'magic_enum', ['cpp'], default_options: ['cpp_std=c++17'], - version: '0.9.3', + version: '0.9.4', ) magic_enum_include = include_directories('include') diff --git a/package.xml b/package.xml index 5d3aefe..18ef4a1 100644 --- a/package.xml +++ b/package.xml @@ -5,7 +5,7 @@ magic_enum - 0.9.3 + 0.9.4 Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code