added type check methods to column_definition
This commit is contained in:
@@ -63,6 +63,46 @@ const std::string &column_definition::ref_column() const
|
||||
return ref_column_;
|
||||
}
|
||||
|
||||
bool column_definition::is_integer() const
|
||||
{
|
||||
return type_ >= data_type_t::type_char && type_ <= data_type_t::type_unsigned_long_long;
|
||||
}
|
||||
|
||||
bool column_definition::is_floating_point() const
|
||||
{
|
||||
return type_ == data_type_t::type_float || type_ == data_type_t::type_double;
|
||||
}
|
||||
|
||||
bool column_definition::is_bool() const
|
||||
{
|
||||
return type_ == data_type_t::type_bool;
|
||||
}
|
||||
|
||||
bool column_definition::is_string() const
|
||||
{
|
||||
return type_ == data_type_t::type_text;
|
||||
}
|
||||
|
||||
bool column_definition::is_varchar() const
|
||||
{
|
||||
return type_ == data_type_t::type_varchar;
|
||||
}
|
||||
|
||||
bool column_definition::is_blob() const
|
||||
{
|
||||
return type_ == data_type_t::type_blob;
|
||||
}
|
||||
|
||||
bool column_definition::is_null() const
|
||||
{
|
||||
return type_ == data_type_t::type_null;
|
||||
}
|
||||
|
||||
bool column_definition::is_unknown() const
|
||||
{
|
||||
return type_ == data_type_t::type_unknown;
|
||||
}
|
||||
|
||||
void column_definition::type(data_type_t type)
|
||||
{
|
||||
type_ = type;
|
||||
|
||||
Reference in New Issue
Block a user