Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/COM_Value.h

Issue 6650591174459392: Issues #276, #1163 - introduce class IncomingParam (Closed)
Patch Set: rewrite incomparable with patch set 1 Created July 29, 2014, 7:52 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/COM_Value.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
+ };
}
}
« no previous file with comments | « no previous file | src/plugin/COM_Value.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld