Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
This struct defines the functions necessary to implement the encoding interface so we can determine how many bytes the subsequent character takes. More...
#include <encoding.h>
Data Fields | |
size_t(* | char_width )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding. More... | |
size_t(* | alpha_char )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphabetical. More... | |
size_t(* | alnum_char )(const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphanumeric. More... | |
bool(* | isupper_char )(const uint8_t *b, ptrdiff_t n) |
Return true if the next character is valid in the encoding and is an uppercase character. More... | |
const char * | name |
The name of the encoding. More... | |
bool | multibyte |
Return true if the encoding is a multibyte encoding. More... | |
This struct defines the functions necessary to implement the encoding interface so we can determine how many bytes the subsequent character takes.
Each callback should return the number of bytes, or 0 if the next bytes are invalid for the encoding and type.
Definition at line 23 of file encoding.h.
size_t(* pm_encoding_t::alnum_char) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphanumeric.
Does not read more than n bytes. It is assumed that n is at least 1.
Definition at line 43 of file encoding.h.
size_t(* pm_encoding_t::alpha_char) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding and is alphabetical.
Does not read more than n bytes. It is assumed that n is at least 1.
Definition at line 36 of file encoding.h.
size_t(* pm_encoding_t::char_width) (const uint8_t *b, ptrdiff_t n) |
Return the number of bytes that the next character takes if it is valid in the encoding.
Does not read more than n bytes. It is assumed that n is at least 1.
Definition at line 29 of file encoding.h.
Referenced by pm_memchr().
bool(* pm_encoding_t::isupper_char) (const uint8_t *b, ptrdiff_t n) |
Return true if the next character is valid in the encoding and is an uppercase character.
Does not read more than n bytes. It is assumed that n is at least 1.
Definition at line 50 of file encoding.h.
bool pm_encoding_t::multibyte |
Return true if the encoding is a multibyte encoding.
Definition at line 61 of file encoding.h.
Referenced by pm_memchr(), and pm_strpbrk().
const char* pm_encoding_t::name |
The name of the encoding.
This should correspond to a value that can be passed to Encoding.find in Ruby.
Definition at line 56 of file encoding.h.
Referenced by pm_serialize_encoding().