Luna/libluna/include/luna/NumberParsing.h

15 lines
628 B
C
Raw Normal View History

2022-11-19 11:30:36 +00:00
#pragma once
#include <luna/Types.h>
2022-11-19 11:30:36 +00:00
// Parse an unsigned integer and advance *str to point to the first non-digit character after the number.
usize scan_unsigned_integer(const char** str, int base = 10);
// Parse a signed integer and advance *str to point to the first non-digit character after the number.
isize scan_signed_integer(const char** str, int base = 10);
// Parse an unsigned integer, similar to strtoull().
usize parse_unsigned_integer(const char* str, const char** endptr, int base);
// Parse a signed integer, similar to strtoll().
2023-01-02 12:07:29 +00:00
isize parse_signed_integer(const char* str, const char** endptr, int base);