28 double ret = strtod(token, &end);
30 if (ret == 0 && end == token) {
46 int64_t input =
xatoll(token, 10);
47 int ret = (
int) input;
49 if (input !=
static_cast<int64_t
>(ret)) {
60 int64_t input =
xatoll(token, 10, eov);
64 unsigned int ret = (
unsigned int) input;
65 if (input !=
static_cast<int64_t
>(ret))
74 int64_t input =
xatoll(token, 10);
75 long ret = (long) input;
77 if (input !=
static_cast<int64_t
>(ret)) {
86xatoll(
const char *token,
int base,
char eov)
89 int64_t ret =
strtoll(token, &end, base);
110 return static_cast<uint64_t
>(
number);
123 if (
port & ~0xFFFF) {
159 int64_t ret =
xatoll(token, 0);
162 if (ret !=
static_cast<int64_t
>(i)) {
189 char* end = &token[strlen(token)-1];
194 int p =
xatoi(token);
196 if (p < 0 || (limit && p > 100)) {
197 debugs(3,
DBG_CRITICAL,
"FATAL: The value '" << token <<
"' is out of range. A percentage should be within [0, 100].");
201 return static_cast<double>(p) / 100.0;
221 const int h = (
int) strtol(s, &ptr, base);
223 if (ptr != s && ptr) {
241 const int64_t h = (int64_t)
strtoll(s, &ptr, base);
243 if (ptr != s && ptr) {
270 t = strchr(host,
']');
278 }
else if ((t = strchr(token,
':'))) {
286 }
else if (strtol(token, &tmp, 10) && !*tmp) {
#define Here()
source code location of the caller
unsigned int xatoui(const char *token, char eov)
double GetPercentage(bool limit)
int64_t xatoll(const char *token, int base, char eov)
bool StringToInt64(const char *s, int64_t &result, const char **p, int base)
bool GetHostWithPort(char *token, Ip::Address *ipa)
uint64_t xatoull(const char *token, int base, char eov)
double xatof(const char *token)
unsigned short xatos(const char *token)
bool StringToInt(const char *s, int &result, const char **p, int base)
int64_t GetInteger64(void)
unsigned short GetShort(void)
long xatol(const char *token)
int xatoi(const char *token)
static char * NextToken()
bool GetHostByName(const char *s)
void setAnyAddr()
NOTE: Does NOT clear the Port stored. Only the Address and Type.
unsigned short port() const
an std::runtime_error with thrower location info
#define DBG_PARSE_NOTE(x)
#define debugs(SECTION, LEVEL, CONTENT)
SBuf ToSBuf(Args &&... args)
slowly stream-prints all arguments into a freshly allocated SBuf
int64_t strtoll(const char *nptr, char **endptr, int base)