LMMS
Loading...
Searching...
No Matches
string_utils.h File Reference
#include "serd/serd.h"
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>

Go to the source code of this file.

Functions

static bool in_range (const int c, const int min, const int max)
static bool is_alpha (const int c)
static bool is_digit (const int c)
static bool is_hexdig (const int c)
static bool is_xdigit (const int c)
static bool is_space (const char c)
static bool is_print (const int c)
static bool is_base64 (const uint8_t c)
static bool is_windows_path (const uint8_t *path)
size_t serd_substrlen (const uint8_t *str, size_t len, size_t *n_bytes, SerdNodeFlags *flags)
static char serd_to_upper (const char c)
static int serd_strncasecmp (const char *s1, const char *s2, size_t n)
static uint32_t utf8_num_bytes (const uint8_t c)
static uint32_t parse_counted_utf8_char (const uint8_t *utf8, size_t size)
 Return the code point of a UTF-8 character with known length.
static uint32_t parse_utf8_char (const uint8_t *utf8, size_t *size)
 Parse a UTF-8 character, set *size to the length, and return the code point.

Variables

static const uint8_t replacement_char [] = {0xEF, 0xBF, 0xBD}

Function Documentation

◆ in_range()

bool in_range ( const int c,
const int min,
const int max )
inlinestatic

Return true if c lies within [min...max] (inclusive)

◆ is_alpha()

bool is_alpha ( const int c)
inlinestatic

RFC2234: ALPHA ::= x41-5A / x61-7A ; A-Z / a-z

◆ is_base64()

bool is_base64 ( const uint8_t c)
inlinestatic

◆ is_digit()

bool is_digit ( const int c)
inlinestatic

RFC2234: DIGIT ::= x30-39 ; 0-9

◆ is_hexdig()

bool is_hexdig ( const int c)
inlinestatic

◆ is_print()

bool is_print ( const int c)
inlinestatic

◆ is_space()

bool is_space ( const char c)
inlinestatic

◆ is_windows_path()

bool is_windows_path ( const uint8_t * path)
inlinestatic

◆ is_xdigit()

bool is_xdigit ( const int c)
inlinestatic

◆ parse_counted_utf8_char()

uint32_t parse_counted_utf8_char ( const uint8_t * utf8,
size_t size )
inlinestatic

Return the code point of a UTF-8 character with known length.

◆ parse_utf8_char()

uint32_t parse_utf8_char ( const uint8_t * utf8,
size_t * size )
inlinestatic

Parse a UTF-8 character, set *size to the length, and return the code point.

◆ serd_strncasecmp()

int serd_strncasecmp ( const char * s1,
const char * s2,
size_t n )
inlinestatic

◆ serd_substrlen()

size_t serd_substrlen ( const uint8_t * str,
size_t len,
size_t * n_bytes,
SerdNodeFlags * flags )

◆ serd_to_upper()

char serd_to_upper ( const char c)
inlinestatic

◆ utf8_num_bytes()

uint32_t utf8_num_bytes ( const uint8_t c)
inlinestatic

Variable Documentation

◆ replacement_char

const uint8_t replacement_char[] = {0xEF, 0xBF, 0xBD}
static

Unicode replacement character in UTF-8