Haio
0.2.X
Homebrew Asset IO/CDN
Toggle main menu visibility
Loading...
Searching...
No Matches
matches.cpp
Go to the documentation of this file.
1
#include <
haio_util.hpp
>
2
3
#include <algorithm>
4
5
namespace
Haio::Util
{
6
7
bool
matches
(
Bytes
data,
Bytes
magic) {
8
return
data.size() >= magic.size() && std::equal(magic.begin(), magic.end(), data.begin());
9
}
10
11
bool
matches
(
Bytes
data, std::string_view magic) {
12
return
data.size() >= magic.size()
13
&& std::equal(magic.begin(), magic.end(), data.begin(), [](
char
a, uint8_t b) {
14
return static_cast<uint8_t>(a) == b;
15
});
16
}
17
18
}
haio_util.hpp
Haio::Util
Definition
haio_util.hpp:15
Haio::Util::matches
bool matches(Bytes data, Bytes magic)
Definition
matches.cpp:7
Haio::Bytes
std::span< const uint8_t > Bytes
Definition
haio_codec.hpp:14
library
common
utils
matches.cpp
Generated by
1.18.0