Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1231)

Unified Diff: base/scoped_variant_win.h

Issue 42569: Adding a Set() method for copying a variant over to the ScopedVariant.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/scoped_variant_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_variant_win.h
===================================================================
--- base/scoped_variant_win.h (revision 12478)
+++ base/scoped_variant_win.h (working copy)
@@ -40,6 +40,15 @@
// VARIANT.lVal (32 bit sized field).
explicit ScopedVariant(int value, VARTYPE vt = VT_I4);
+ // VT_DISPATCH
+ explicit ScopedVariant(IDispatch* dispatch);
+
+ // VT_UNKNOWN
+ explicit ScopedVariant(IUnknown* unknown);
+
+ // Copies the variant.
+ explicit ScopedVariant(const VARIANT& var);
+
~ScopedVariant();
inline VARTYPE type() const {
@@ -83,6 +92,11 @@
void Set(double r64);
void Set(bool b);
+ // Creates a copy of |var| and assigns as this instance's value.
+ // Note that this is different from the Reset() method that's used to
+ // free the current value and assume ownership.
+ void Set(const VARIANT& var);
+
// COM object setters
void Set(IDispatch* disp);
void Set(IUnknown* unk);
@@ -102,6 +116,10 @@
return &var_;
}
+ // Like other scoped classes (e.g scoped_refptr, ScopedComPtr, ScopedBstr)
+ // we support the assignment operator for the type we wrap.
+ ScopedVariant& operator=(const VARIANT& var);
+
// A hack to pass a pointer to the variant where the accepting
// function treats the variant as an input-only, read-only value
// but the function prototype requires a non const variant pointer.
« no previous file with comments | « no previous file | base/scoped_variant_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698