double Str_parseDouble(const char *s) { if (STR_UNDEF(s)) THROW(SQLException, "NumberFormatException: For input string null"); errno = 0; char *e; double d = strtod(s, &e); if (errno || (e == s)) THROW(SQLException, "NumberFormatException: For input string %s -- %s", s, System_getLastError()); return d; }
T URL_create(const char *url, ...) { if (STR_UNDEF(url)) return NULL; Exception_init(); va_list ap; va_start(ap, url); T U = ctor((uchar_t*)Str_vcat(url, ap)); va_end(ap); return U; }
long long int Str_parseLLong(const char *s) { if (STR_UNDEF(s)) THROW(SQLException, "NumberFormatException: For input string null"); errno = 0; char *e; long long l = strtoll(s, &e, 10); if (errno || (e == s)) THROW(SQLException, "NumberFormatException: For input string %s -- %s", s, System_getLastError()); return l; }
int Str_parseInt(const char *s) { int i; char *e; if (STR_UNDEF(s)) THROW(NumberFormatException, "For input string null"); errno = 0; i = (int)strtol(s, &e, 10); if (errno || (e == s)) THROW(NumberFormatException, "For input string %s -- %s", s, System_getError(errno)); return i; }
T URL_new(const char *url) { if (STR_UNDEF(url)) return NULL; Exception_init(); return ctor((uchar_t*)Str_dup(url)); }