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

Last change on this file since 4207 was 4194, checked in by nmedfort, 5 years ago

Modified RE module to use a LLVM-like dyn_cast system; added 'make' functions to hide RE constructors.

File size: 794 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//Regular Expressions
11#include "re/re_re.h"
12#include "re/re_cc.h"
13
14
15class UTF8_Encoder
16{
17public:
18    static re::RE* toUTF8(re::RE * re);
19private:
20    static re::RE* rangeToUTF8(const re::CharSetItem &item);
21    static re::RE* rangeToUTF8_helper(int lo, int hi, int n, int hlen);
22    static re::CC* makeByteClass(int byteval);
23    static re::CC* makeByteRange(int lo, int hi);
24
25    static bool u8Prefix(int cp);
26    static int u8len(int cp);
27    static int max_of_u8len(int lgth);
28    static int u8byte(int codepoint, int n);
29};
30
31#endif // UTF8_ENCODER_H
Note: See TracBrowser for help on using the repository browser.