Go to the source code of this file.
#define CAST_FLOAT_TO_STRING |
( |
|
float_type, |
|
|
|
format |
|
) |
| |
Value:
\
if (isnan(val.val)) return
StringVal("nan"); \
\
sv.len = snprintf(reinterpret_cast<char*>(sv.ptr), sv.len, format, val.val); \
DCHECK_GT(sv.len, 0); \
DCHECK_LE(sv.len, MAX_FLOAT_CHARS); \
AnyValUtil::TruncateIfNecessary(return_type, &sv); \
return sv; \
}
const int MAX_FLOAT_CHARS
Definition at line 122 of file cast-functions.cc.
#define CAST_FROM_STRING |
( |
|
num_type, |
|
|
|
native_type, |
|
|
|
string_parser_fn |
|
) |
| |
Value:
if (val.
is_null) return num_type::null(); \
num_type ret; \
reinterpret_cast<char*>(val.ptr), val.len, &result); \
return ret; \
}
Definition at line 90 of file cast-functions.cc.
#define CAST_FROM_SUBSECOND_TIMESTAMP |
( |
|
to_type | ) |
|
Value:to_type CastFunctions::CastTo##to_type( \
if (val.
is_null) return to_type::null(); \
if (!tv.HasDate()) return to_type::null(); \
return to_type(tv.ToSubsecondUnixTime()); \
}
This object has a compatible storage format with boost::ptime.
Definition at line 208 of file cast-functions.cc.
#define CAST_FROM_TIMESTAMP |
( |
|
to_type | ) |
|
Value:to_type CastFunctions::CastTo##to_type( \
if (val.
is_null) return to_type::null(); \
if (!tv.HasDate()) return to_type::null(); \
return to_type(tv.ToUnixTime()); \
}
This object has a compatible storage format with boost::ptime.
Definition at line 193 of file cast-functions.cc.
#define CAST_FUNCTION |
( |
|
from_type, |
|
|
|
to_type |
|
) |
| |
Value:to_type CastFunctions::CastTo##to_type(
FunctionContext* ctx,
const from_type& val) { \
if (val.is_null) return to_type::null(); \
return to_type(val.val); \
}
Definition at line 35 of file cast-functions.cc.
#define CAST_TO_STRING |
( |
|
num_type | ) |
|
#define CAST_TO_TIMESTAMP |
( |
|
from_type | ) |
|
Value:
const from_type& val) { \
if (!timestamp_value.HasDate()) return
TimestampVal::null(); \
timestamp_value.ToTimestampVal(&result); \
return result; \
}
This object has a compatible storage format with boost::ptime.
Definition at line 220 of file cast-functions.cc.
CAST_FLOAT_TO_STRING |
( |
FloatVal |
, |
|
|
"%.9g" |
|
|
) |
| |
CAST_FROM_SUBSECOND_TIMESTAMP |
( |
FloatVal |
| ) |
|
CAST_FROM_TIMESTAMP |
( |
IntVal |
| ) |
|
const int MAX_FLOAT_CHARS = 24 |