Changeset View
Changeset View
Standalone View
Standalone View
src/util/strencodings.h
Show First 20 Lines • Show All 100 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Convert string to signed 64-bit integer with strict parse error feedback. | * Convert string to signed 64-bit integer with strict parse error feedback. | ||||
* @returns true if the entire string could be parsed as valid integer, false if | * @returns true if the entire string could be parsed as valid integer, false if | ||||
* not the entire string could be parsed or when overflow or underflow occurred. | * not the entire string could be parsed or when overflow or underflow occurred. | ||||
*/ | */ | ||||
NODISCARD bool ParseInt64(const std::string &str, int64_t *out); | NODISCARD bool ParseInt64(const std::string &str, int64_t *out); | ||||
/** | /** | ||||
* Convert decimal string to unsigned 8-bit integer with strict parse error | |||||
* feedback. | |||||
* @returns true if the entire string could be parsed as valid integer, | |||||
* false if not the entire string could be parsed or when overflow or | |||||
* underflow occurred. | |||||
*/ | |||||
NODISCARD bool ParseUInt8(const std::string &str, uint8_t *out); | |||||
/** | |||||
* Convert decimal string to unsigned 32-bit integer with strict parse error | * Convert decimal string to unsigned 32-bit integer with strict parse error | ||||
* feedback. | * feedback. | ||||
* @returns true if the entire string could be parsed as valid integer, false if | * @returns true if the entire string could be parsed as valid integer, false if | ||||
* not the entire string could be parsed or when overflow or underflow occurred. | * not the entire string could be parsed or when overflow or underflow occurred. | ||||
*/ | */ | ||||
NODISCARD bool ParseUInt32(const std::string &str, uint32_t *out); | NODISCARD bool ParseUInt32(const std::string &str, uint32_t *out); | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 155 Lines • Show Last 20 Lines |