2011-08-15 00:55:43 +00:00
|
|
|
|
#pragma once
|
|
|
|
|
|
2012-09-05 19:51:09 +00:00
|
|
|
|
#include <map>
|
|
|
|
|
|
2011-08-15 00:55:43 +00:00
|
|
|
|
#include <Poco/RegularExpression.h>
|
|
|
|
|
|
2011-08-18 20:33:20 +00:00
|
|
|
|
#include <DB/DataTypes/IDataType.h>
|
2011-08-15 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
|
{
|
|
|
|
|
|
2012-10-29 02:58:52 +00:00
|
|
|
|
/** Позволяет создать тип данных по его имени.
|
2011-08-15 00:55:43 +00:00
|
|
|
|
*/
|
|
|
|
|
class DataTypeFactory
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
DataTypeFactory();
|
2011-09-19 01:42:16 +00:00
|
|
|
|
DataTypePtr get(const String & name) const;
|
2011-08-15 00:55:43 +00:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
typedef std::map<String, DataTypePtr> NonParametricDataTypes;
|
|
|
|
|
NonParametricDataTypes non_parametric_data_types;
|
|
|
|
|
|
2014-07-01 01:03:16 +00:00
|
|
|
|
Poco::RegularExpression fixed_string_regexp {R"--(^FixedString\s*\(\s*(\d+)\s*\)$)--"};
|
|
|
|
|
|
|
|
|
|
Poco::RegularExpression nested_regexp {R"--(^(\w+)\s*\(\s*(.+)\s*\)$)--",
|
|
|
|
|
Poco::RegularExpression::RE_MULTILINE | Poco::RegularExpression::RE_DOTALL};
|
2011-08-15 00:55:43 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|