| Index: src/plugin/COM_Value.h |
| =================================================================== |
| --- a/src/plugin/COM_Value.h |
| +++ b/src/plugin/COM_Value.h |
| @@ -115,6 +115,48 @@ |
| */ |
| BSTR_Argument& operator=(BSTR_Argument&&); // = delete |
| }; |
| + |
| + /** |
| + * Constructor class for [in] parameters arriving from our COM entry points. |
| + * |
| + * The life cycle of a VARIANT value that comes to us as an [in] parameter is entirely managed by the caller. |
| + * Thus the responsbilities of this class are for type checking and value conversion, |
| + * but not life cycle mangement. |
| + * |
| + * This class is specifically for use within COM server functions such as for IDispatch::Invoke. |
| + * |
| + * \par Status |
| + * This class is, in part, written for issue #1163 "Clean up IDispatch::Invoke implementations". |
| + * |
| + */ |
| + class IncomingParam |
| + { |
| + /** |
| + * The underlying variant value. |
| + * |
| + * It's stored as received and does receive any life cycle treatment. |
| + */ |
| + VARIANT var; |
| + |
| + public: |
| + IncomingParam( VARIANT v ) |
| + : var( v ) |
| + { |
| + } |
| + |
| + /** |
| + * Predicate whether the variant is convertible to std::wstring. |
| + * |
| + * This predicate incorporates both type compatibility and implementation support. |
| + * Some types that could be converted are not, simply because they're not used in the present code base. |
| + */ |
| + bool wstringConvertible() const; |
| + |
| + /** |
| + * Convert variant to std::wstring and if not convertible return the empty string. |
| + */ |
| + std::wstring wstringValueNoexcept() const; |
| + }; |
| } |
| } |