added type check methods to column_definition

This commit is contained in:
2024-03-29 11:40:02 +01:00
parent e14d9a77eb
commit 05c0c0393d
2 changed files with 49 additions and 0 deletions
+40
View File
@@ -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;