Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Routines to query chacater types. More...
#include "ruby/onigmo.h"
#include "ruby/internal/attr/const.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/encoding/encoding.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Functions | |
static bool | rb_enc_is_newline (const char *p, const char *e, rb_encoding *enc) |
Queries if the passed pointer points to a newline character. More... | |
static bool | rb_enc_isctype (OnigCodePoint c, OnigCtype t, rb_encoding *enc) |
Queries if the passed code point is of passed character type in the passed encoding. More... | |
static bool | rb_enc_isascii (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isascii(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isalpha (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isalpha(), except it additionally takes an encoding. More... | |
static bool | rb_enc_islower (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_islower(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isupper (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isupper(), except it additionally takes an encoding. More... | |
static bool | rb_enc_iscntrl (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_iscntrl(), except it additionally takes an encoding. More... | |
static bool | rb_enc_ispunct (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_ispunct(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isalnum (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isalnum(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isprint (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isprint(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isspace (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isspace(), except it additionally takes an encoding. More... | |
static bool | rb_enc_isdigit (OnigCodePoint c, rb_encoding *enc) |
Identical to rb_isdigit(), except it additionally takes an encoding. More... | |
int | rb_enc_toupper (int c, rb_encoding *enc) |
Identical to rb_toupper(), except it additionally takes an encoding. More... | |
int | rb_enc_tolower (int c, rb_encoding *enc) |
Identical to rb_tolower(), except it additionally takes an encoding. More... | |
Routines to query chacater types.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file ctype.h.
|
inlinestatic |
Queries if the passed pointer points to a newline character.
What is a newline and what is not depends on the passed encoding.
[in] | p | Pointer to a possibly-middle of a character. |
[in] | end | End of the string. |
[in] | enc | Encoding. |
false | It isn't. |
true | It is. |
|
inlinestatic |
Identical to rb_isalnum(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "ANUM". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isalpha(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "ALPHA". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isascii(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
false | c is out of range of ASCII character set in enc . |
true | Otherwise. |
Definition at line 82 of file ctype.h.
Referenced by rb_enc_ascget(), and rb_str_inspect().
|
inlinestatic |
Identical to rb_iscntrl(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "CNTRL". |
false | Otherwise. |
|
inlinestatic |
Queries if the passed code point is of passed character type in the passed encoding.
The "character type" here is a set of macros defined in onigmo.h, like ONIGENC_CTYPE_PUNCT
.
[in] | c | An OnigCodePoint value. |
[in] | t | An OnigCtype value. |
[in] | enc | A rb_encoding* value. |
true | c is of t in enc . |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isdigit(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "DIGIT". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_islower(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "LOWER". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isprint(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "PRINT". |
false | Otherwise. |
Definition at line 180 of file ctype.h.
Referenced by rb_str_format(), and rb_str_inspect().
|
inlinestatic |
Identical to rb_ispunct(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "PUNCT". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isspace(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "PRINT". |
false | Otherwise. |
|
inlinestatic |
Identical to rb_isupper(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
true | enc classifies c as "UPPER". |
false | Otherwise. |
int rb_enc_tolower | ( | int | c, |
rb_encoding * | enc | ||
) |
Identical to rb_tolower(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
c
's (Ruby's definition of) lower case counterpart. Definition at line 1257 of file encoding.c.
int rb_enc_toupper | ( | int | c, |
rb_encoding * | enc | ||
) |
Identical to rb_toupper(), except it additionally takes an encoding.
[in] | c | A code point. |
[in] | enc | An encoding. |
c
's (Ruby's definition of) upper case counterpart. Definition at line 1251 of file encoding.c.
Referenced by rb_str_format().