| Qore DataProvider Module Reference 2.7.1

QoreDataType.qc.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3
26 namespace DataProvider {
28
31 class QoreDataType : public AbstractDataProviderType {
32
33 public:
34 protected:
36 Type type;
37
39 bool soft_type;
40
42 bool or_nothing_type;
43
45
50 hash<string, bool> base_type_hash;
51
53 *hash<string, bool> accept_type_hash;
54
56 *hash<string, bool> return_type_hash;
57
59 hash<string, bool> blacklist_type_hash;
60
62 const SupportedOptions = {
63 "qore.no_null": <DataProviderTypeOptionInfo>{
64 "type": Type::Boolean,
65 "desc": "if True then NULL is not supported on input if NOTHING is also not accepted",
66 },
67 };
68
70 const SoftTypeMap = {
71 "int": SoftIntType,
72 "bool": SoftBoolType,
73 "float": SoftFloatType,
74 "number": SoftNumberType,
75 "string": SoftStringType,
76 "date": SoftDateType,
77 "list": SoftAutoListType,
78 "*int": SoftIntOrNothingType,
79 "*bool": SoftBoolOrNothingType,
80 "*float": SoftFloatOrNothingType,
81 "*number": SoftNumberOrNothingType,
82 "*string": SoftStringOrNothingType,
83 "*date": SoftDateOrNothingType,
84 "*list": SoftAutoListOrNothingType,
85 };
86
87 public:
88
90 constructor(Type type, *hash<auto> options, *hash<auto> tags);
91
92
94 string getName();
95
96
98 string getDesc();
99
100
102 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
103
104
106 *Type getValueType();
107
108
110 *hash<string, bool> getDirectTypeHash();
111
112
114 *AbstractDataProviderType getElementType();
115
116
118
124 auto acceptsValue(auto value);
125
126
128 *hash<string, AbstractDataField> getFields();
129
130
132 hash<string, bool> getAcceptTypeHash();
133
134
136 hash<string, bool> getReturnTypeHash();
137
138
140 hash<DataTypeInfo> getInfo();
141
142
144
146 AbstractDataProviderType getSoftType();
147
148
150
152 AbstractDataProviderType getOrNothingType();
153
154 };
155 };
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:187
DataProvider::AbstractDataProviderType::tags
*hash< auto > tags
type tags
Definition: AbstractDataProviderType.qc.dox.h:203
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:200
DataProvider::QoreDataType
describes a data type based on a Qore data type
Definition: QoreDataType.qc.dox.h:31
DataProvider::QoreDataType::or_nothing_type
bool or_nothing_type
flag for "or nothing" types
Definition: QoreDataType.qc.dox.h:42
DataProvider::QoreDataType::getReturnTypeHash
hash< string, bool > getReturnTypeHash()
returns a hash of base types returned by this type; keys are type names
DataProvider::QoreDataType::SupportedOptions
const SupportedOptions
supported options
Definition: QoreDataType.qc.dox.h:62
DataProvider::QoreDataType::getOrNothingType
AbstractDataProviderType getOrNothingType()
returns an "or nothing" type equivalent to the current type
DataProvider::QoreDataType::getElementType
*AbstractDataProviderType getElementType()
returns the subtype (for lists or hashes) if there is only one
DataProvider::QoreDataType::accept_type_hash
*hash< string, bool > accept_type_hash
hash of base types accepted by this type; keys are type names
Definition: QoreDataType.qc.dox.h:53
DataProvider::QoreDataType::base_type_hash
hash< string, bool > base_type_hash
hash of base types where no translations are performed; keys are type codes, not names
Definition: QoreDataType.qc.dox.h:50
DataProvider::QoreDataType::return_type_hash
*hash< string, bool > return_type_hash
hash of base types returned by this type; keys are type names
Definition: QoreDataType.qc.dox.h:56
DataProvider::QoreDataType::type
Type type
the Qore type
Definition: QoreDataType.qc.dox.h:36
DataProvider::QoreDataType::soft_type
bool soft_type
flag for soft types
Definition: QoreDataType.qc.dox.h:39
DataProvider::QoreDataType::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options
DataProvider::QoreDataType::acceptsValue
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
DataProvider::QoreDataType::constructor
constructor(Type type, *hash< auto > options, *hash< auto > tags)
creates the type
DataProvider::QoreDataType::SoftTypeMap
const SoftTypeMap
map from normal types to soft types
Definition: QoreDataType.qc.dox.h:70
DataProvider::QoreDataType::getValueType
*Type getValueType()
returns the base type for the type, if any
DataProvider::QoreDataType::getSoftType
AbstractDataProviderType getSoftType()
returns a "soft" type equivalent to the current type
DataProvider::QoreDataType::getAcceptTypeHash
hash< string, bool > getAcceptTypeHash()
returns a hash of base types accepted by this type; keys are type names
DataProvider::QoreDataType::getName
string getName()
returns the type name
DataProvider::QoreDataType::blacklist_type_hash
hash< string, bool > blacklist_type_hash
hash of type codes accepted by the base type but not accepted by this type: code -> True
Definition: QoreDataType.qc.dox.h:59
DataProvider::QoreDataType::getDesc
string getDesc()
Returns the description.
DataProvider::QoreDataType::getDirectTypeHash
*hash< string, bool > getDirectTypeHash()
returns a hash of native base type code where no translations are performed; keys are type codes,...
DataProvider::QoreDataType::getFields
*hash< string, AbstractDataField > getFields()
returns the fields of the data structure; if any
DataProvider::QoreDataType::getInfo
hash< DataTypeInfo > getInfo()
returns a description of the type as a hash
Boolean
const Boolean
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::DataProviderTypeOptionInfo
describes type options
Definition: AbstractDataProviderType.qc.dox.h:125