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

Last change on this file since 5684 was 5278, checked in by cameron, 3 years ago

Alphabet class: initial check-in

File size: 977 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
[5278]10#include <UCD/unicode_set.h>
[3850]11
[4249]12namespace cc {
[3850]13
[4814]14struct UTF8_Encoder {
[5278]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);
[3850]23};
24
[4249]25}
26
[3850]27#endif // UTF8_ENCODER_H
Note: See TracBrowser for help on using the repository browser.