45 VARTYPE
Type()
const {
return vartype_; }
48 size_t Size()
const {
return vector_.size(); }
51 bool Empty()
const {
return vector_.empty(); }
58 template <VARTYPE ExpectedVartype,
59 std::enable_if_t<ExpectedVartype != VT_BOOL, int> = 0>
61 if (vartype_ == VT_EMPTY)
62 vartype_ = ExpectedVartype;
63 AssertVartype<ExpectedVartype>();
66 vector_.push_back(std::move(scoped_variant));
71 template <VARTYPE ExpectedVartype,
72 std::enable_if_t<ExpectedVartype == VT_BOOL, int> = 0>
74 if (vartype_ == VT_EMPTY)
75 vartype_ = ExpectedVartype;
76 AssertVartype<ExpectedVartype>();
79 vector_.push_back(std::move(scoped_variant));
86 if (vartype_ == VT_EMPTY)
88 AssertVartype<VT_DATE>();
91 vector_.push_back(std::move(scoped_variant));
98 VARIANT ReleaseAsScalarVariant();
102 VARIANT ReleaseAsSafearrayVariant();
107 int Compare(
const VARIANT& other,
bool ignore_case =
false)
const;
110 int Compare(SAFEARRAY* safearray,
bool ignore_case =
false)
const;
113 int Compare(
const VariantVector& other,
bool ignore_case =
false)
const;
118 template <VARTYPE ExpectedVartype>
119 void AssertVartype()
const {
122 <<
"Type mismatch, " << ExpectedVartype <<
" is not convertible to "
129 template <VARTYPE ElementVartype>
130 SAFEARRAY* CreateAndPopulateSafearray();
132 VARTYPE vartype_ = VT_EMPTY;
133 std::vector<ScopedVariant> vector_;