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

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

First stage of CC_NameMap removal

File size: 959 bytes
RevLine 
[3850]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
[4249]10#include <re/re_cc.h>
[3850]11
[4249]12namespace cc {
[3850]13
[4814]14struct UTF8_Encoder {
[4615]15    static bool isPrefix(const re::codepoint_t cp);
16    static unsigned length(const re::codepoint_t cp);
[4614]17    static re::codepoint_t maxCodePoint(const unsigned length);
[4615]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);
[3850]23};
24
[4249]25}
26
[3850]27#endif // UTF8_ENCODER_H
Note: See TracBrowser for help on using the repository browser.