QoreDataType.qc.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
// assume local scope for variables, do not use "$" signs
// require type definitions everywhere
// enable all warnings
namespace DataProvider {
class QoreDataType : public AbstractDataProviderType {
public:
protected:
Type type;
bool soft_type;
bool or_nothing_type;
hash<string, bool> base_type_hash;
*hash<string, bool> accept_type_hash;
*hash<string, bool> return_type_hash;
hash<string, bool> blacklist_type_hash;
const SupportedOptions = {
"qore.no_null": <DataProviderTypeOptionInfo>{
"type": Type::Boolean,
"desc": "if True then NULL is not supported on input if NOTHING is also not accepted",
},
};
const SoftTypeMap = {
"int": SoftIntType,
"bool": SoftBoolType,
"float": SoftFloatType,
"number": SoftNumberType,
"string": SoftStringType,
"date": SoftDateType,
"list": SoftAutoListType,
"*int": SoftIntOrNothingType,
"*bool": SoftBoolOrNothingType,
"*float": SoftFloatOrNothingType,
"*number": SoftNumberOrNothingType,
"*string": SoftStringOrNothingType,
"*date": SoftDateOrNothingType,
"*list": SoftAutoListOrNothingType,
};
public:
constructor(Type type, *hash<auto> options);
string getName();
*hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
*Type getValueType();
*hash<string, bool> getDirectTypeHash();
*AbstractDataProviderType getElementType();
auto acceptsValue(auto value);
*hash<string, AbstractDataField> getFields();
hash<string, bool> getAcceptTypeHash();
hash<string, bool> getReturnTypeHash();
hash<DataTypeInfo> getInfo();
AbstractDataProviderType getSoftType();
AbstractDataProviderType getOrNothingType();
};
};
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:56
DataProvider::QoreDataType::getInfo
hash< DataTypeInfo > getInfo()
returns a description of the type as a hash
DataProvider::QoreDataType::SupportedOptions
const SupportedOptions
supported options
Definition: QoreDataType.qc.dox.h:68
DataProvider::AbstractDataProviderType
describes a data type
Definition: AbstractDataProviderType.qc.dox.h:161
DataProvider::QoreDataType::acceptsValue
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
DataProvider::QoreDataType::getValueType
*Type getValueType()
returns the base type for the type, if any
DataProvider::QoreDataType::SoftTypeMap
const SoftTypeMap
map from normal types to soft types
Definition: QoreDataType.qc.dox.h:76
DataProvider::QoreDataType::getFields
*hash< string, AbstractDataField > getFields()
returns the fields of the data structure; if any
DataProvider::QoreDataType::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:32
DataProvider::QoreDataType::or_nothing_type
bool or_nothing_type
flag for "or nothing" types
Definition: QoreDataType.qc.dox.h:48
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:59
DataProvider::DataProviderTypeOptionInfo
describes type options
Definition: AbstractDataProviderType.qc.dox.h:122
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::getOrNothingType
AbstractDataProviderType getOrNothingType()
returns an "or nothing" type equivalent to the current type
DataProvider::QoreDataType::getName
string getName()
returns the type name
DataProvider::QoreDataType::soft_type
bool soft_type
flag for soft types
Definition: QoreDataType.qc.dox.h:45
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:65
DataProvider::AbstractDataProviderType::options
hash< auto > options
type options
Definition: AbstractDataProviderType.qc.dox.h:169
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:62
DataProvider::QoreDataType::getReturnTypeHash
hash< string, bool > getReturnTypeHash()
returns a hash of base types returned by this type; keys are type names
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::getElementType
*AbstractDataProviderType getElementType()
returns the subtype (for lists or hashes) if there is only one
DataProvider::AbstractDataProviderType::constructor
constructor()
creates the type
DataProvider::QoreDataType::type
Type type
the Qore type
Definition: QoreDataType.qc.dox.h:42
DataProvider::QoreDataType
describes a data type based on a Qore data type
Definition: QoreDataType.qc.dox.h:37
Boolean
const Boolean