aboutsummaryrefslogtreecommitdiff
path: root/src/utility.cc
blob: 9d81f614a9efe18624998b88b0faf369d314dc5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "utility.h"

namespace UTF8 {
namespace dtl {

bool match(const std::uint8_t& codeUnit, CodeUnitType&& type) {
	return codeUnit & static_cast<std::uint8_t>(type);
}

void write(char32_t& codePoint,
           const std::uint8_t& codeUnit,
           CodePoint&& mask,
           const std::uint8_t& offset) {
	codePoint += (codeUnit & static_cast<std::uint8_t>(mask)) << offset;
}

}
}