OLD | NEW |
1 /** | 1 /** |
2 * \file COM_Value.h Support for the values used in COM and Automation. | 2 * \file COM_Value.h Support for the values used in COM and Automation. |
3 */ | 3 */ |
4 #ifndef COM_VALUE_H | 4 #ifndef COM_VALUE_H |
5 #define COM_VALUE_H | 5 #define COM_VALUE_H |
6 | 6 |
7 #include <wtypes.h> | 7 #include <wtypes.h> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace AdblockPlus | 10 namespace AdblockPlus |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 /** | 108 /** |
109 * Copy assignment is deleted | 109 * Copy assignment is deleted |
110 */ | 110 */ |
111 BSTR_Argument& operator=(const BSTR_Argument&); // = delete | 111 BSTR_Argument& operator=(const BSTR_Argument&); // = delete |
112 | 112 |
113 /** | 113 /** |
114 * Move assignment is deleted | 114 * Move assignment is deleted |
115 */ | 115 */ |
116 BSTR_Argument& operator=(BSTR_Argument&&); // = delete | 116 BSTR_Argument& operator=(BSTR_Argument&&); // = delete |
117 }; | 117 }; |
| 118 |
| 119 /** |
| 120 * Constructor class for [in] parameters arriving from our COM entry points. |
| 121 * |
| 122 * The life cycle of a VARIANT value that comes to us as an [in] parameter i
s entirely managed by the caller. |
| 123 * Thus the responsbilities of this class are for type checking and value co
nversion, |
| 124 * but not life cycle mangement. |
| 125 * |
| 126 * This class is specifically for use within COM server functions such as fo
r IDispatch::Invoke. |
| 127 * |
| 128 * \par Status |
| 129 * This class is, in part, written for issue #1163 "Clean up IDispatch::In
voke implementations". |
| 130 * |
| 131 */ |
| 132 class IncomingParam |
| 133 { |
| 134 /** |
| 135 * The underlying variant value. |
| 136 * |
| 137 * It's stored as received and does receive any life cycle treatment. |
| 138 */ |
| 139 VARIANT var; |
| 140 |
| 141 public: |
| 142 IncomingParam( VARIANT v ) |
| 143 : var( v ) |
| 144 { |
| 145 } |
| 146 |
| 147 /** |
| 148 * Predicate whether the variant is convertible to std::wstring. |
| 149 * |
| 150 * This predicate incorporates both type compatibility and implementation
support. |
| 151 * Some types that could be converted are not, simply because they're not
used in the present code base. |
| 152 */ |
| 153 bool wstringConvertible() const; |
| 154 |
| 155 /** |
| 156 * Convert variant to std::wstring and if not convertible return the empty
string. |
| 157 */ |
| 158 std::wstring wstringValueNoexcept() const; |
| 159 }; |
118 } | 160 } |
119 } | 161 } |
120 | 162 |
121 #endif | 163 #endif |
OLD | NEW |