String validation functions.
More...
#include "dist/sds/sds.h"
#include <stdbool.h>
Go to the source code of this file.
String validation functions.
◆ validate_callback
typedef bool(* validate_callback) (sds) |
Definition for the validation callback used by the jsonrpc functions
◆ check_dir_traversal()
bool check_dir_traversal |
( |
const char * |
str | ) |
|
Checks for dir traversal attempts in string
- Parameters
-
- Returns
- true if filepath is sane, else false
◆ validate_json_array()
bool validate_json_array |
( |
sds |
data | ) |
|
Checks if string is a json array
- Parameters
-
- Returns
- true on success else false
◆ validate_json_object()
bool validate_json_object |
( |
sds |
data | ) |
|
Public functions Checks if string is a json object
- Parameters
-
- Returns
- true on success else false
◆ vcb_isalnum()
bool vcb_isalnum |
( |
sds |
data | ) |
|
Checks if string is alphanumeric, including chars "_-"
- Parameters
-
- Returns
- true on success else false
◆ vcb_isdigit()
bool vcb_isdigit |
( |
sds |
data | ) |
|
Checks if string is a number
- Parameters
-
- Returns
- true on success else false
◆ vcb_isfield()
bool vcb_isfield |
( |
sds |
data | ) |
|
Checks if string is a valid column name
- Parameters
-
- Returns
- true on success else false
◆ vcb_isfilename()
bool vcb_isfilename |
( |
sds |
data | ) |
|
Checks if string is a valid filename
- Parameters
-
- Returns
- true on success else false
◆ vcb_isfilename_silent()
bool vcb_isfilename_silent |
( |
sds |
data | ) |
|
Checks if string is a valid filename Does not emit a warning
- Parameters
-
- Returns
- true on success else false
◆ vcb_isfilepath()
bool vcb_isfilepath |
( |
sds |
data | ) |
|
Checks if string is a valid filename with path or path only
- Parameters
-
- Returns
- true on success else false
◆ vcb_ishexcolor()
bool vcb_ishexcolor |
( |
sds |
data | ) |
|
Checks if string is a hexcolor starting with #
- Parameters
-
- Returns
- true on success else false
◆ vcb_ismpd_sticker_sort()
bool vcb_ismpd_sticker_sort |
( |
sds |
data | ) |
|
Checks if string is valid sticker or mpd sort type
- Parameters
-
- Returns
- bool true on success else false
◆ vcb_ismpdsort()
bool vcb_ismpdsort |
( |
sds |
data | ) |
|
Checks if string is a valid sort tag for mpd
- Parameters
-
- Returns
- true on success else false
◆ vcb_ismpdstickertype()
bool vcb_ismpdstickertype |
( |
sds |
data | ) |
|
Checks if string is a valid MPD sticker type
- Parameters
-
- Returns
- true on success, else false
◆ vcb_ismpdtag()
bool vcb_ismpdtag |
( |
sds |
data | ) |
|
Checks if string is a valid MPD tag
- Parameters
-
- Returns
- true on success else false
◆ vcb_ismpdtag_or_any()
bool vcb_ismpdtag_or_any |
( |
sds |
data | ) |
|
Checks if string is a valid MPD tag or special value "any"
- Parameters
-
- Returns
- true on success else false
◆ vcb_isname()
bool vcb_isname |
( |
sds |
data | ) |
|
Checks if string contains invalid chars Invalid chars are "\a\b\f\n\r\t\v"
- Parameters
-
- Returns
- true on success else false
◆ vcb_ispathfilename()
bool vcb_ispathfilename |
( |
sds |
data | ) |
|
Checks if string is a valid path + filename
- Parameters
-
- Returns
- true on success else false
◆ vcb_isplaylistsort()
bool vcb_isplaylistsort |
( |
sds |
data | ) |
|
Checks if string is a valid sort tag for mpd
- Parameters
-
- Returns
- true on success else false
◆ vcb_isprint()
bool vcb_isprint |
( |
sds |
data | ) |
|
Checks if string is printable
- Parameters
-
- Returns
- true on success else false
◆ vcb_issearchexpression_song()
bool vcb_issearchexpression_song |
( |
sds |
data | ) |
|
Checks if string is a valid song search expression
- Parameters
-
- Returns
- true on success else false
◆ vcb_issearchexpression_webradio()
bool vcb_issearchexpression_webradio |
( |
sds |
data | ) |
|
Checks if string is a valid song search expression
- Parameters
-
- Returns
- true on success else false
◆ vcb_isstickerop()
bool vcb_isstickerop |
( |
sds |
data | ) |
|
Checks if string is a compare operator
- Parameters
-
- Returns
- true on success else false
◆ vcb_isstickersort()
bool vcb_isstickersort |
( |
sds |
data | ) |
|
Checks if string is a valid sticker sort type
- Parameters
-
- Returns
- true on success else false
◆ vcb_isstreamuri()
bool vcb_isstreamuri |
( |
sds |
data | ) |
|
Checks if string is a valid stream uri
- Parameters
-
- Returns
- true on success else false
◆ vcb_istaglist()
bool vcb_istaglist |
( |
sds |
data | ) |
|
Checks if string is a valid comma separated list of tags
- Parameters
-
- Returns
- true on success else false
◆ vcb_istext()
bool vcb_istext |
( |
sds |
data | ) |
|
Checks if string contains invalid chars Invalid chars are "\a\b\f\r\v"
- Parameters
-
- Returns
- true on success else false
◆ vcb_isuri()
bool vcb_isuri |
( |
sds |
data | ) |
|
Checks if string is a valid uri or filepath
- Parameters
-
- Returns
- true on success else false
◆ vcb_iswebradiosort()
bool vcb_iswebradiosort |
( |
sds |
data | ) |
|
Checks if string is a valid sort tag for webradios
- Parameters
-
- Returns
- true on success else false