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

Last change on this file since 4212 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
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
10//Regular Expressions
[4187]11#include "re/re_re.h"
12#include "re/re_cc.h"
[3850]13
14
15class UTF8_Encoder
16{
17public:
[4194]18    static re::RE* toUTF8(re::RE * re);
[3850]19private:
[4194]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);
[3850]24
[3961]25    static bool u8Prefix(int cp);
[3914]26    static int u8len(int cp);
27    static int max_of_u8len(int lgth);
28    static int u8byte(int codepoint, int n);
[3850]29};
30
31#endif // UTF8_ENCODER_H
Note: See TracBrowser for help on using the repository browser.