-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6071cc3
commit 29b4710
Showing
15 changed files
with
180 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
|
||
#include <concepts> | ||
|
||
namespace esc::detail { | ||
|
||
/** | ||
* Concept that checks if T is the same as any of Args. | ||
* | ||
* @details This does not check reference qualifiers, std::decay is used on T. | ||
* @tparam T The type to check. | ||
* @tparam Args The types to check against. | ||
*/ | ||
template <typename T, typename... Args> | ||
concept AnyOf = (std::is_same_v<Args, std::decay_t<T>> || ...); | ||
|
||
} // namespace esc::detail |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include <array> | ||
#include <string> | ||
#include <string_view> | ||
|
||
namespace esc::detail { | ||
|
||
/** | ||
* Convert the given char32_t to its UTF8 reprensentation. | ||
* | ||
* @param c The char32_t to convert. | ||
* @return The UTF8 bytes. | ||
*/ | ||
[[nodiscard]] auto u32_to_u8(char32_t c) -> std::string; | ||
|
||
/** | ||
* Convert the given char32_t string to its UTF8 reprensentation. | ||
* | ||
* @param s The char32_t string to convert. | ||
* @return The UTF8 bytes. | ||
*/ | ||
[[nodiscard]] auto u32_to_u8(std::u32string_view s) -> std::string; | ||
|
||
/** | ||
* Convert a UTF8 array of bytes into a UTF32 char32_t. | ||
* | ||
* @param bytes The UTF8 array of bytes to convert. Unused bytes should be null. | ||
* @return The char32_t bytes. | ||
*/ | ||
[[nodiscard]] auto u8_to_u32(std::array<char, 4> bytes) -> char32_t; | ||
|
||
} // namespace esc::detail |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.