🧵 str
Painfully common string utilities for C
Loading...
Searching...
No Matches
predicate.h File Reference

Predicate functions to test characters and strings with. More...

#include "str.h"

Go to the source code of this file.

Functions

bool char_is_alnum (char c)
 Checks if a character is alphanumeric.
bool char_is_alpha (char c)
 Checks if a character is alphabetic.
bool char_is_lower (char c)
 Checks if a character is lowercase.
bool char_is_upper (char c)
 Checks if a character is uppercase.
bool char_is_digit (char c)
 Checks if a character is a digit.
bool char_is_xdigit (char c)
 Checks if a character is a hexadecimal digit.
bool char_is_cntrl (char c)
 Checks if a character is control character.
bool char_is_graph (char c)
 Checks if a character is graphical character.
bool char_is_space (char c)
 Checks if a character is a space character.
bool char_is_blank (char c)
 Checks if a character is a blank character.
bool char_is_print (char c)
 Checks if a character is a printing character.
bool char_is_punct (char c)
 Checks if a character is a punctuation character.
bool cstr_is_alnum (const char *c)
 Checks if a string is entirely alphanumeric.
bool cstr_is_alpha (const char *c)
 Checks if a string is entirely alphabetic.
bool cstr_is_lower (const char *c)
 Checks if a string is entirely lowercase.
bool cstr_is_upper (const char *c)
 Checks if a string is entirely uppercase.
bool cstr_is_digit (const char *c)
 Checks if a string is entirely made of digits.
bool cstr_is_xdigit (const char *c)
 Checks if a string is entirely made of hexadecimal digits.
bool cstr_is_cntrl (const char *c)
 Checks if a string is entirely made of control characters.
bool cstr_is_graph (const char *c)
 Checks if a string is entirely made of graphical characters.
bool cstr_is_space (const char *c)
 Checks if a string is entirely made of space characters.
bool cstr_is_blank (const char *c)
 Checks if a string is entirely made of blank characters.
bool cstr_is_print (const char *c)
 Checks if a string is entirely made of printing characters.
bool cstr_is_punct (const char *c)
 Checks if a string is entirely made of punctuation characters.
bool str_is_alnum (str c)
 Checks if a string is entirely alphanumeric.
bool str_is_alpha (str c)
 Checks if a string is entirely alphabetic.
bool str_is_lower (str c)
 Checks if a string is entirely lowercase.
bool str_is_upper (str c)
 Checks if a string is entirely uppercase.
bool str_is_digit (str c)
 Checks if a string is entirely made of digits.
bool str_is_xdigit (str c)
 Checks if a string is entirely made of hexadecimal digits.
bool str_is_cntrl (str c)
 Checks if a string is entirely made of control characters.
bool str_is_graph (str c)
 Checks if a string is entirely made of graphical characters.
bool str_is_space (str c)
 Checks if a string is entirely made of space characters.
bool str_is_blank (str c)
 Checks if a string is entirely made of blank characters.
bool str_is_print (str c)
 Checks if a string is entirely made of printing characters.
bool str_is_punct (str c)
 Checks if a string is entirely made of punctuation characters.

Detailed Description

Predicate functions to test characters and strings with.

Function Documentation

◆ char_is_alnum()

bool char_is_alnum ( char c)

Checks if a character is alphanumeric.

This is a convenience wrapper of type bool (char) for isalnum(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isalnum()

◆ char_is_alpha()

bool char_is_alpha ( char c)

Checks if a character is alphabetic.

This is a convenience wrapper of type bool (char) for isalpha(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isalpha()

◆ char_is_blank()

bool char_is_blank ( char c)

Checks if a character is a blank character.

This is a convenience wrapper of type bool (char) for isblank(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C99 isblank()

◆ char_is_cntrl()

bool char_is_cntrl ( char c)

Checks if a character is control character.

This is a convenience wrapper of type bool (char) for iscntrl(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 iscntrl()

◆ char_is_digit()

bool char_is_digit ( char c)

Checks if a character is a digit.

This is a convenience wrapper of type bool (char) for isdigit(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isdigit()

◆ char_is_graph()

bool char_is_graph ( char c)

Checks if a character is graphical character.

This is a convenience wrapper of type bool (char) for isgraph(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isgraph()

◆ char_is_lower()

bool char_is_lower ( char c)

Checks if a character is lowercase.

This is a convenience wrapper of type bool (char) for islower(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 islower()

◆ char_is_print()

bool char_is_print ( char c)

Checks if a character is a printing character.

This is a convenience wrapper of type bool (char) for isprint(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isprint()

◆ char_is_punct()

bool char_is_punct ( char c)

Checks if a character is a punctuation character.

This is a convenience wrapper of type bool (char) for ispunct(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 ispunct()

◆ char_is_space()

bool char_is_space ( char c)

Checks if a character is a space character.

This is a convenience wrapper of type bool (char) for isspace(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isspace()

◆ char_is_upper()

bool char_is_upper ( char c)

Checks if a character is uppercase.

This is a convenience wrapper of type bool (char) for isupper(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isupper()

◆ char_is_xdigit()

bool char_is_xdigit ( char c)

Checks if a character is a hexadecimal digit.

This is a convenience wrapper of type bool (char) for isxdigit(), which is of type int (int) and would otherwise be incompatible with functions in this library accepting predicates.

See also
C89 isxdigit()

◆ cstr_is_alnum()

bool cstr_is_alnum ( const char * c)

Checks if a string is entirely alphanumeric.

See also
char_is_alnum(char)
C89 isalnum()

◆ cstr_is_alpha()

bool cstr_is_alpha ( const char * c)

Checks if a string is entirely alphabetic.

See also
char_is_alpha(char)
C89 isalpha()

◆ cstr_is_blank()

bool cstr_is_blank ( const char * c)

Checks if a string is entirely made of blank characters.

See also
char_is_blank(char)
C99 isblank()

◆ cstr_is_cntrl()

bool cstr_is_cntrl ( const char * c)

Checks if a string is entirely made of control characters.

See also
char_is_cntrl(char)
C89 iscntrl()

◆ cstr_is_digit()

bool cstr_is_digit ( const char * c)

Checks if a string is entirely made of digits.

See also
char_is_digit(char)
C89 isdigit()

◆ cstr_is_graph()

bool cstr_is_graph ( const char * c)

Checks if a string is entirely made of graphical characters.

See also
char_is_graph(char)
C89 isgraph()

◆ cstr_is_lower()

bool cstr_is_lower ( const char * c)

Checks if a string is entirely lowercase.

See also
char_is_lower(char)
C89 islower()

◆ cstr_is_print()

bool cstr_is_print ( const char * c)

Checks if a string is entirely made of printing characters.

See also
char_is_print(char)
C89 isprint()

◆ cstr_is_punct()

bool cstr_is_punct ( const char * c)

Checks if a string is entirely made of punctuation characters.

See also
char_is_punct(char)
C89 ispunct()

◆ cstr_is_space()

bool cstr_is_space ( const char * c)

Checks if a string is entirely made of space characters.

See also
char_is_space(char)
C89 isspace()

◆ cstr_is_upper()

bool cstr_is_upper ( const char * c)

Checks if a string is entirely uppercase.

See also
char_is_upper(char)
C89 isupper()

◆ cstr_is_xdigit()

bool cstr_is_xdigit ( const char * c)

Checks if a string is entirely made of hexadecimal digits.

See also
char_is_xdigit(char)
C89 isxdigit()

◆ str_is_alnum()

bool str_is_alnum ( str c)

Checks if a string is entirely alphanumeric.

See also
char_is_alnum(char)
C89 isalnum()

◆ str_is_alpha()

bool str_is_alpha ( str c)

Checks if a string is entirely alphabetic.

See also
char_is_alpha(char)
C89 isalpha()

◆ str_is_blank()

bool str_is_blank ( str c)

Checks if a string is entirely made of blank characters.

See also
char_is_blank(char)
C99 isblank()

◆ str_is_cntrl()

bool str_is_cntrl ( str c)

Checks if a string is entirely made of control characters.

See also
char_is_cntrl(char)
C89 iscntrl()

◆ str_is_digit()

bool str_is_digit ( str c)

Checks if a string is entirely made of digits.

See also
char_is_digit(char)
C89 isdigit()

◆ str_is_graph()

bool str_is_graph ( str c)

Checks if a string is entirely made of graphical characters.

See also
char_is_graph(char)
C89 isgraph()

◆ str_is_lower()

bool str_is_lower ( str c)

Checks if a string is entirely lowercase.

See also
char_is_lower(char)
C89 islower()

◆ str_is_print()

bool str_is_print ( str c)

Checks if a string is entirely made of printing characters.

See also
char_is_print(char)
C89 isprint()

◆ str_is_punct()

bool str_is_punct ( str c)

Checks if a string is entirely made of punctuation characters.

See also
char_is_punct(char)
C89 ispunct()

◆ str_is_space()

bool str_is_space ( str c)

Checks if a string is entirely made of space characters.

See also
char_is_space(char)
C89 isspace()

◆ str_is_upper()

bool str_is_upper ( str c)

Checks if a string is entirely uppercase.

See also
char_is_upper(char)
C89 isupper()

◆ str_is_xdigit()

bool str_is_xdigit ( str c)

Checks if a string is entirely made of hexadecimal digits.

See also
char_is_xdigit(char)
C89 isxdigit()