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

Unified Diff: src/plugin/ATL_Deprecate.h

Issue 6224768520945664: Issue #276 - conversion functions between std::wstring and ATL::CString (Closed)
Patch Set: Created Aug. 1, 2014, 2:33 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
Index: src/plugin/ATL_Deprecate.h
===================================================================
--- a/src/plugin/ATL_Deprecate.h
+++ b/src/plugin/ATL_Deprecate.h
@@ -128,6 +128,7 @@
#else
namespace OLD_ATL {
#endif
+#pragma deprecated( CComBSTR )
#pragma deprecated( CRect )
#pragma deprecated( CSimpleArray )
}
@@ -141,3 +142,33 @@
* ATLTRACE resolves to a ATL::CTraceFileAndLineInfo.
* These will need to be replaced or removed.
*/
+
+
+/*
+ * Transient functions used during the ATL removal process.
+ *
+ * Trying to convert all the string instances at once leads to massive change sets.
+ * In order to be able to convert incrementally, we'll need to undergo a period where we're mixing types.
+ * The functions below are explicit conversion functions.
+ * While it's possible to convert them by direct calls to member functions,
+ * using explicit conversion functions will allow us to ensure we've removed all the conversions when we're done.
+ *
+ * These are declared in ATL_Deprecate.h to ensure that they're all removed before we ATL removal is complete.
+ *
+ * Reference:
+ * MSDN CString http://msdn.microsoft.com/en-us/library/aa300688%28v=vs.60%29.aspx
+ */
+
+#include <string>
+/**
+ * Conversion function from ATL:CString to std::wstring
+ *
+ * The argument cannot be declared 'const' because of the CString API.
+ * Reference argument usually does not require explicit temporaries.
+ */
+std::wstring to_wstring(const ATL::CString& s);
+
+/**
+ * Conversion function from std::wstring to ATL::CString
+ */
+ATL::CString to_CString(const std::wstring& s);
« no previous file with comments | « adblockplus.gyp ('k') | src/plugin/ATL_Deprecate.cpp » ('j') | src/plugin/ATL_Deprecate.cpp » ('J')

Powered by Google App Engine
This is Rietveld