$darkmode

| Qore DataProvider Module Reference 2.7.1

QoreStringDataTypeBase.qc.dox.h
1// -*- mode: c++; indent-tabs-mode: nil -*-
3
25// assume local scope for variables, do not use "$" signs
26// require type definitions everywhere
28// enable all warnings
29
31 namespace DataProvider {
33
36 class QoreStringDataTypeBase : public QoreDataType {
37
38 public:
39 protected:
41 const SupportedOptions = QoreDataType::SupportedOptions + {
42 "string.encoding": <DataProviderTypeOptionInfo>{
43 "type": Type::String,
44 "desc": "the output encoding when writing to the type",
45 },
46 // the max_size_chars option is to be enforced externally
47 "string.max_size_chars": <DataProviderTypeOptionInfo>{
48 "type": Type::Int,
49 "desc": "the maximum length of the string in characters",
50 },
51 };
52
54 const SupportedOrNothingOptions = {
55 // only used with "or nothing" types
56 "string.empty_to_nothing": <DataProviderTypeOptionInfo>{
57 "type": Type::Boolean,
58 "desc": "if an empty string should be converted to no value",
59 },
60 };
61
62 public:
63
65
67 constructor(Type type, *hash<auto> options, *hash<auto> tags) ;
68
69
71
77 auto acceptsValue(auto value);
78
79
81 *hash<string, hash<DataProviderTypeOptionInfo>> getSupportedOptions();
82
83
85
87 AbstractDataProviderType getSoftType();
88
89
91 protected:
92 setOptionInternal(string opt, auto value);
93 public:
94
95};
96};
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::SupportedOptions
const SupportedOptions
supported options
Definition: QoreDataType.qc.dox.h:62
DataProvider::QoreDataType::type
Type type
the Qore type
Definition: QoreDataType.qc.dox.h:36
DataProvider::QoreStringDataTypeBase
describes a data type based on a string tyoe with a target encoding option
Definition: QoreStringDataTypeBase.qc.dox.h:36
DataProvider::QoreStringDataTypeBase::setOptionInternal
setOptionInternal(string opt, auto value)
sets the given option without any validation of the option
DataProvider::QoreStringDataTypeBase::SupportedOrNothingOptions
const SupportedOrNothingOptions
supported "or nothing" options
Definition: QoreStringDataTypeBase.qc.dox.h:54
DataProvider::QoreStringDataTypeBase::constructor
constructor(Type type, *hash< auto > options, *hash< auto > tags)
creates the object with the given options
DataProvider::QoreStringDataTypeBase::acceptsValue
auto acceptsValue(auto value)
returns the value if the value can be assigned to the type
DataProvider::QoreStringDataTypeBase::SupportedOptions
const SupportedOptions
supported options
Definition: QoreStringDataTypeBase.qc.dox.h:41
DataProvider::QoreStringDataTypeBase::getSupportedOptions
*hash< string, hash< DataProviderTypeOptionInfo > > getSupportedOptions()
returns supported options
DataProvider::QoreStringDataTypeBase::getSoftType
AbstractDataProviderType getSoftType()
returns a "soft" type equivalent to the current type
String
const String
Boolean
const Boolean
Int
const Int
DataProvider
Qore AbstractDataField class definition.
Definition: AbstractDataField.qc.dox.h:27
DataProvider::DataProviderTypeOptionInfo
describes type options
Definition: AbstractDataProviderType.qc.dox.h:125