bloaty/third_party/re2/util/utf.h
Go to the documentation of this file.
1 /*
2  * The authors of this software are Rob Pike and Ken Thompson.
3  * Copyright (c) 2002 by Lucent Technologies.
4  * Permission to use, copy, modify, and distribute this software for any
5  * purpose without fee is hereby granted, provided that this entire notice
6  * is included in all copies of any software which is or includes a copy
7  * or modification of this software and in all copies of the supporting
8  * documentation for such software.
9  * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
10  * WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
11  * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
12  * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
13  *
14  * This file and rune.cc have been converted to compile as C++ code
15  * in name space re2.
16  */
17 
18 #ifndef UTIL_UTF_H_
19 #define UTIL_UTF_H_
20 
21 #include <stdint.h>
22 
23 namespace re2 {
24 
25 typedef signed int Rune; /* Code-point values in Unicode 4.0 are 21 bits wide.*/
26 
27 enum
28 {
29  UTFmax = 4, /* maximum bytes per rune */
30  Runesync = 0x80, /* cannot represent part of a UTF sequence (<) */
31  Runeself = 0x80, /* rune and UTF sequences are the same (<) */
32  Runeerror = 0xFFFD, /* decoding error in UTF */
33  Runemax = 0x10FFFF, /* maximum rune value */
34 };
35 
36 int runetochar(char* s, const Rune* r);
37 int chartorune(Rune* r, const char* s);
38 int fullrune(const char* s, int n);
39 int utflen(const char* s);
40 char* utfrune(const char*, Rune);
41 
42 } // namespace re2
43 
44 #endif // UTIL_UTF_H_
re2::fullrune
int fullrune(const char *str, int n)
Definition: bloaty/third_party/re2/util/rune.cc:192
re2::utflen
int utflen(const char *s)
Definition: bloaty/third_party/re2/util/rune.cc:212
re2::utfrune
char * utfrune(const char *s, Rune c)
Definition: bloaty/third_party/re2/util/rune.cc:233
re2::Runesync
@ Runesync
Definition: bloaty/third_party/re2/util/utf.h:30
re2
Definition: bloaty/third_party/re2/re2/bitmap256.h:17
re2::Runeself
@ Runeself
Definition: bloaty/third_party/re2/util/utf.h:31
re2::runetochar
int runetochar(char *str, const Rune *rune)
Definition: bloaty/third_party/re2/util/rune.cc:127
stdint.h
re2::Rune
signed int Rune
Definition: bloaty/third_party/re2/util/utf.h:25
fix_build_deps.r
r
Definition: fix_build_deps.py:491
re2::chartorune
int chartorune(Rune *rune, const char *str)
Definition: bloaty/third_party/re2/util/rune.cc:51
re2::Runeerror
@ Runeerror
Definition: bloaty/third_party/re2/util/utf.h:32
re2::Runemax
@ Runemax
Definition: bloaty/third_party/re2/util/utf.h:33
re2::UTFmax
@ UTFmax
Definition: bloaty/third_party/re2/util/utf.h:29


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:48