|
solidc
Robust collection of general-purpose cross-platform C libraries and data structures designed for rapid and safe development in C
|
String to number conversion utilities. More...
#include <stdbool.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| StoError | str_to_u8 (const char *str, uint8_t *result) |
| Converts a string to a uint8_t. | |
| StoError | str_to_i8 (const char *str, int8_t *result) |
| Converts a string to an int8_t. | |
| StoError | str_to_u16 (const char *str, uint16_t *result) |
| Converts a string to a uint16_t. | |
| StoError | str_to_i16 (const char *str, int16_t *result) |
| Converts a string to an int16_t. | |
| StoError | str_to_u32 (const char *str, uint32_t *result) |
| Converts a string to a uint32_t. | |
| StoError | str_to_i32 (const char *str, int32_t *result) |
| Converts a string to an int32_t. | |
| StoError | str_to_u64 (const char *str, uint64_t *result) |
| Converts a string to a uint64_t. | |
| StoError | str_to_i64 (const char *str, int64_t *result) |
| Converts a string to an int64_t. | |
| StoError | str_to_ulong (const char *str, unsigned long *result) |
| Converts a string to an unsigned long. | |
| StoError | str_to_long (const char *str, long *result) |
| Converts a string to a long. | |
| StoError | str_to_double (const char *str, double *result) |
| Converts a string to a double. | |
| StoError | str_to_float (const char *str, float *result) |
| Converts a string to a float. | |
| StoError | str_to_uint (const char *str, unsigned int *result) |
| Converts a string to an unsigned int. | |
| StoError | str_to_uintptr (const char *str, uintptr_t *result) |
| Converts a string to a uintptr_t. | |
| StoError | str_to_int (const char *str, int *result) |
| Converts a string to an int. | |
| StoError | str_to_ulong_base (const char *str, int base, unsigned long *result) |
| Converts a string to an unsigned long with a specified base. | |
| StoError | str_to_long_base (const char *str, int base, long *result) |
| Converts a string to a long with a specified base. | |
| StoError | str_to_int_base (const char *str, int base, int *result) |
| Converts a string to an int with a specified base. | |
| StoError | str_to_bool (const char *str, bool *result) |
| Converts a string to a boolean. Valid inputs are "true", "false", "yes", "no", "1", "0", "on", "off". | |
| const char * | sto_error_string (StoError code) |
String to number conversion utilities.
Definition in file str_to_num.h.
| const char * sto_error_string | ( | StoError | code | ) |
Report the numerical conversion error from code.
Definition at line 273 of file str_to_num.c.
References sto_error_string().
Referenced by sto_error_string().
| StoError str_to_bool | ( | const char * | str, |
| bool * | result | ||
| ) |
Converts a string to a boolean. Valid inputs are "true", "false", "yes", "no", "1", "0", "on", "off".
| str | The input string. |
| result | Pointer to the result variable. |
Definition at line 257 of file str_to_num.c.
References str_to_bool().
Referenced by str_to_bool().
| StoError str_to_double | ( | const char * | str, |
| double * | result | ||
| ) |
Converts a string to a double.
| str | The input string. |
| result | Pointer to the result variable. |
Definition at line 229 of file str_to_num.c.
References str_to_double().
Referenced by str_to_double().
| StoError str_to_float | ( | const char * | str, |
| float * | result | ||
| ) |
Converts a string to a float.
| str | The input string. |
| result | Pointer to the result variable. |
Definition at line 213 of file str_to_num.c.
References str_to_float().
Referenced by str_to_float().
| StoError str_to_i16 | ( | const char * | str, |
| int16_t * | result | ||
| ) |
Converts a string to an int16_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_i32 | ( | const char * | str, |
| int32_t * | result | ||
| ) |
Converts a string to an int32_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_i64 | ( | const char * | str, |
| int64_t * | result | ||
| ) |
Converts a string to an int64_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_i8 | ( | const char * | str, |
| int8_t * | result | ||
| ) |
Converts a string to an int8_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_int | ( | const char * | str, |
| int * | result | ||
| ) |
Converts a string to an int.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_int_base | ( | const char * | str, |
| int | base, | ||
| int * | result | ||
| ) |
Converts a string to an int with a specified base.
| str | The input string. |
| base | The base for conversion. |
| result | Pointer to the result variable. |
| StoError str_to_long | ( | const char * | str, |
| long * | result | ||
| ) |
Converts a string to a long.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_long_base | ( | const char * | str, |
| int | base, | ||
| long * | result | ||
| ) |
Converts a string to a long with a specified base.
| str | The input string. |
| base | The base for conversion. |
| result | Pointer to the result variable. |
| StoError str_to_u16 | ( | const char * | str, |
| uint16_t * | result | ||
| ) |
Converts a string to a uint16_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_u32 | ( | const char * | str, |
| uint32_t * | result | ||
| ) |
Converts a string to a uint32_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_u64 | ( | const char * | str, |
| uint64_t * | result | ||
| ) |
Converts a string to a uint64_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_u8 | ( | const char * | str, |
| uint8_t * | result | ||
| ) |
Converts a string to a uint8_t.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_uint | ( | const char * | str, |
| unsigned int * | result | ||
| ) |
Converts a string to an unsigned int.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_uintptr | ( | const char * | str, |
| uintptr_t * | result | ||
| ) |
Converts a string to a uintptr_t.
uintptr_t is an unsigned integer type that is capable of storing a data pointer.
| str | The input string. |
| result | Pointer to the result variable. |
Definition at line 196 of file str_to_num.c.
| StoError str_to_ulong | ( | const char * | str, |
| unsigned long * | result | ||
| ) |
Converts a string to an unsigned long.
| str | The input string. |
| result | Pointer to the result variable. |
| StoError str_to_ulong_base | ( | const char * | str, |
| int | base, | ||
| unsigned long * | result | ||
| ) |
Converts a string to an unsigned long with a specified base.
| str | The input string. |
| base | The base for conversion. |
| result | Pointer to the result variable. |