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

Last change on this file since 5805 was 5278, checked in by cameron, 2 years ago

Alphabet class: initial check-in

File size: 977 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 <UCD/unicode_set.h>
11
12namespace cc {
13
14struct UTF8_Encoder {
15    static bool isPrefix(const UCD::codepoint_t cp);
16    static unsigned length(const UCD::codepoint_t cp);
17    static UCD::codepoint_t maxCodePoint(const unsigned length);
18    static UCD::codepoint_t encodingByte(const UCD::codepoint_t cp, const unsigned n);
19    static bool isLowCodePointAfterByte(const UCD::codepoint_t cp, const unsigned n);
20    static bool isHighCodePointAfterByte(const UCD::codepoint_t cp, const unsigned n);
21    static UCD::codepoint_t minCodePointWithCommonBytes(const UCD::codepoint_t cp, const unsigned n);
22    static UCD::codepoint_t maxCodePointWithCommonBytes(const UCD::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.