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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/plugin/COM_Value.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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