5#ifndef ADA_CHECKERS_INL_H
6#define ADA_CHECKERS_INL_H
18 uint32_t value_one = 1;
19 bool is_little_endian = (
reinterpret_cast<char*
>(&value_one)[0] == 1);
21 std::memcpy(&word0x,
"0x", 2);
23 uint16_t two_first_bytes{};
24 std::memcpy(&two_first_bytes, input.data(), 2);
25 if (is_little_endian) {
26 two_first_bytes |= 0x2000;
28 two_first_bytes |= 0x020;
30 return two_first_bytes == word0x;
37constexpr bool is_digit(
char x)
noexcept {
return (x >=
'0') & (x <=
'9'); }
39constexpr char to_lower(
char x)
noexcept {
return (x | 0x20); }
46 return input.size() >= 2 &&
47 (
is_alpha(input[0]) && ((input[1] ==
':') || (input[1] ==
'|'))) &&
48 ((input.size() == 2) || (input[2] ==
'/' || input[2] ==
'\\' ||
49 input[2] ==
'?' || input[2] ==
'#'));
53 std::string_view input)
noexcept {
54 return input.size() >= 2 && (
is_alpha(input[0]) && (input[1] ==
':'));
58 std::string_view prefix) {
61 return view.size() >= prefix.size() &&
62 std::equal(prefix.begin(), prefix.end(), view.begin());
Common definitions for cross-platform compiler support.
#define ada_really_inline
Includes the definitions for validation functions.
bool has_hex_prefix_unsafe(std::string_view input)
constexpr bool is_normalized_windows_drive_letter(std::string_view input) noexcept
constexpr bool is_windows_drive_letter(std::string_view input) noexcept
constexpr char to_lower(char x) noexcept
bool has_hex_prefix(std::string_view input)
constexpr bool is_alpha(char x) noexcept
constexpr bool is_digit(char x) noexcept
ada_really_inline bool begins_with(std::string_view view, std::string_view prefix)