5#ifndef BASE_WIN_VARIANT_VECTOR_H_
6#define BASE_WIN_VARIANT_VECTOR_H_
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;
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_;
void Set(const wchar_t *str)
VariantVector & operator=(const VariantVector &)=delete
VariantVector(const VariantVector &)=delete
void Insert(typename internal::VariantUtil< ExpectedVartype >::Type value)
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
bool operator!=(C p1, const scoped_nsprotocol< C > &p2)
def Compare(symbols1, symbols2)
typename VartypeToNativeType< ElementVartype >::Type Type
#define BASE_DCHECK(condition)