aboutsummaryrefslogtreecommitdiff
path: root/src/utility.cc
blob: 92ba7b91ca8c58db561ae11e4810bf70799b8aee (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 uint8_t& codeUnit, CodeUnitType&& type) {
	return codeUnit & static_cast<uint8_t>(type);
}

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

}
}