OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_SCOPED_VARIANT_WIN_H_ | 5 #ifndef BASE_SCOPED_VARIANT_WIN_H_ |
6 #define BASE_SCOPED_VARIANT_WIN_H_ | 6 #define BASE_SCOPED_VARIANT_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <oleauto.h> | 9 #include <oleauto.h> |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 // be transferred | 33 // be transferred |
34 explicit ScopedVariant(const wchar_t* str); | 34 explicit ScopedVariant(const wchar_t* str); |
35 | 35 |
36 // Creates a new VT_BSTR variant of a specified length. | 36 // Creates a new VT_BSTR variant of a specified length. |
37 explicit ScopedVariant(const wchar_t* str, UINT length); | 37 explicit ScopedVariant(const wchar_t* str, UINT length); |
38 | 38 |
39 // Creates a new integral type variant and assigns the value to | 39 // Creates a new integral type variant and assigns the value to |
40 // VARIANT.lVal (32 bit sized field). | 40 // VARIANT.lVal (32 bit sized field). |
41 explicit ScopedVariant(int value, VARTYPE vt = VT_I4); | 41 explicit ScopedVariant(int value, VARTYPE vt = VT_I4); |
42 | 42 |
| 43 // Creates a new double-precision type variant. |vt| must be either VT_R8 |
| 44 // or VT_DATE. |
| 45 explicit ScopedVariant(double value, VARTYPE vt = VT_R8); |
| 46 |
43 // VT_DISPATCH | 47 // VT_DISPATCH |
44 explicit ScopedVariant(IDispatch* dispatch); | 48 explicit ScopedVariant(IDispatch* dispatch); |
45 | 49 |
46 // VT_UNKNOWN | 50 // VT_UNKNOWN |
47 explicit ScopedVariant(IUnknown* unknown); | 51 explicit ScopedVariant(IUnknown* unknown); |
48 | 52 |
| 53 // SAFEARRAY |
| 54 explicit ScopedVariant(SAFEARRAY* safearray); |
| 55 |
49 // Copies the variant. | 56 // Copies the variant. |
50 explicit ScopedVariant(const VARIANT& var); | 57 explicit ScopedVariant(const VARIANT& var); |
51 | 58 |
52 ~ScopedVariant(); | 59 ~ScopedVariant(); |
53 | 60 |
54 inline VARTYPE type() const { | 61 inline VARTYPE type() const { |
55 return var_.vt; | 62 return var_.vt; |
56 } | 63 } |
57 | 64 |
58 // Give ScopedVariant ownership over an already allocated VARIANT. | 65 // Give ScopedVariant ownership over an already allocated VARIANT. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 151 |
145 private: | 152 private: |
146 // Comparison operators for ScopedVariant are not supported at this point. | 153 // Comparison operators for ScopedVariant are not supported at this point. |
147 // Use the Compare method instead. | 154 // Use the Compare method instead. |
148 bool operator==(const ScopedVariant& var) const; | 155 bool operator==(const ScopedVariant& var) const; |
149 bool operator!=(const ScopedVariant& var) const; | 156 bool operator!=(const ScopedVariant& var) const; |
150 DISALLOW_COPY_AND_ASSIGN(ScopedVariant); | 157 DISALLOW_COPY_AND_ASSIGN(ScopedVariant); |
151 }; | 158 }; |
152 | 159 |
153 #endif // BASE_SCOPED_VARIANT_WIN_H_ | 160 #endif // BASE_SCOPED_VARIANT_WIN_H_ |
OLD | NEW |