source: icGREP/icgrep-devel/icgrep/utf8_encoder.h @ 5230

Last change on this file since 5230 was 4819, checked in by nmedfort, 4 years ago

First stage of CC_NameMap removal

File size: 959 bytes
Line 
1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef UTF8_ENCODER_H
8#define UTF8_ENCODER_H
9
10#include <re/re_cc.h>
11
12namespace cc {
13
14struct UTF8_Encoder {
15    static bool isPrefix(const re::codepoint_t cp);
16    static unsigned length(const re::codepoint_t cp);
17    static re::codepoint_t maxCodePoint(const unsigned length);
18    static re::codepoint_t encodingByte(const re::codepoint_t cp, const unsigned n);
19    static bool isLowCodePointAfterByte(const re::codepoint_t cp, const unsigned n);
20    static bool isHighCodePointAfterByte(const re::codepoint_t cp, const unsigned n);
21    static re::codepoint_t minCodePointWithCommonBytes(const re::codepoint_t cp, const unsigned n);
22    static re::codepoint_t maxCodePointWithCommonBytes(const re::codepoint_t cp, const unsigned n);
23};
24
25}
26
27#endif // UTF8_ENCODER_H
Note: See TracBrowser for help on using the repository browser.