source: icGREP/icgrep-devel/icgrep/utf16_encoder.h @ 5812

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

Alphabet class: initial check-in

File size: 1.0 KB
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 UTF16_ENCODER_H
8#define UTF16_ENCODER_H
9
10#include <UCD/unicode_set.h>
11
12namespace cc {
13
14struct UTF16_Encoder {
15    static bool isHi_Surrogate(const UCD::codepoint_t cp);
16    static bool isLo_Surrogate(const UCD::codepoint_t cp);
17    static unsigned length(const UCD::codepoint_t cp);
18    static UCD::codepoint_t maxCodePoint(const unsigned length);
19    static UCD::codepoint_t encodingByte(const UCD::codepoint_t cp, const unsigned n);
20    static bool isLowCodePointAfterByte(const UCD::codepoint_t cp, const unsigned n);
21    static bool isHighCodePointAfterByte(const UCD::codepoint_t cp, const unsigned n);
22    static UCD::codepoint_t minCodePointWithCommonBytes(const UCD::codepoint_t cp, const unsigned n);
23    static UCD::codepoint_t maxCodePointWithCommonBytes(const UCD::codepoint_t cp, const unsigned n);
24};
25
26}
27
28#endif // UTF16_ENCODER_H
Note: See TracBrowser for help on using the repository browser.