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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * \file ATL_Deprecate.h Include package for all the ATL headers, with optional forwarding to detect ATL dependencies. 2 * \file ATL_Deprecate.h Include package for all the ATL headers, with optional forwarding to detect ATL dependencies.
3 * 3 *
4 * This header is a nexus for refactoring work to remove ATL. 4 * This header is a nexus for refactoring work to remove ATL.
5 * The main purpose of this mechanism is to determine the exact scope of the ref actoring effort. 5 * The main purpose of this mechanism is to determine the exact scope of the ref actoring effort.
6 * The lifetime of this header is during the work on #276 Stop using ATL https:/ /issues.adblockplus.org/ticket/276 6 * The lifetime of this header is during the work on #276 Stop using ATL https:/ /issues.adblockplus.org/ticket/276
7 * 7 *
8 * This file implements namespace forwarding that allows detection of ATL symbol s. 8 * This file implements namespace forwarding that allows detection of ATL symbol s.
9 * This forwarding is ordinarily disabled, and always disabled in Release config uration for safety. 9 * This forwarding is ordinarily disabled, and always disabled in Release config uration for safety.
10 * When forwarding is disabled, it simply includes the ATL headers. 10 * When forwarding is disabled, it simply includes the ATL headers.
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 #endif 121 #endif
122 122
123 /* 123 /*
124 * Deprecation pragmas use the compiler to identify refactoring targets. 124 * Deprecation pragmas use the compiler to identify refactoring targets.
125 */ 125 */
126 #if DISABLE_ATL_FORWARDING 126 #if DISABLE_ATL_FORWARDING
127 namespace ATL { 127 namespace ATL {
128 #else 128 #else
129 namespace OLD_ATL { 129 namespace OLD_ATL {
130 #endif 130 #endif
131 #pragma deprecated( CComBSTR )
131 #pragma deprecated( CRect ) 132 #pragma deprecated( CRect )
132 #pragma deprecated( CSimpleArray ) 133 #pragma deprecated( CSimpleArray )
133 } 134 }
134 135
135 /* 136 /*
136 * Note: 137 * Note:
137 * The preprocessor symbols ATLASSERT and ATLTRACE appear in the source. 138 * The preprocessor symbols ATLASSERT and ATLTRACE appear in the source.
138 * These resolve to nothing in Release configurations. 139 * These resolve to nothing in Release configurations.
139 * In Debug configurations, these are non-trivial. 140 * In Debug configurations, these are non-trivial.
140 * ATLASSERT resolves to an expression with _CrtDbgReportW and _CrtDbgBreak. 141 * ATLASSERT resolves to an expression with _CrtDbgReportW and _CrtDbgBreak.
141 * ATLTRACE resolves to a ATL::CTraceFileAndLineInfo. 142 * ATLTRACE resolves to a ATL::CTraceFileAndLineInfo.
142 * These will need to be replaced or removed. 143 * These will need to be replaced or removed.
143 */ 144 */
145
146
147 /*
148 * Transient functions used during the ATL removal process.
149 *
150 * Trying to convert all the string instances at once leads to massive change se ts.
151 * In order to be able to convert incrementally, we'll need to undergo a period where we're mixing types.
152 * The functions below are explicit conversion functions.
153 * While it's possible to convert them by direct calls to member functions,
154 * using explicit conversion functions will allow us to ensure we've removed a ll the conversions when we're done.
155 *
156 * These are declared in ATL_Deprecate.h to ensure that they're all removed befo re we ATL removal is complete.
157 *
158 * Reference:
159 * MSDN CString http://msdn.microsoft.com/en-us/library/aa300688%28v=vs.60%29. aspx
160 */
161
162 #include <string>
163 /**
164 * Conversion function from ATL:CString to std::wstring
165 *
166 * The argument cannot be declared 'const' because of the CString API.
167 * Reference argument usually does not require explicit temporaries.
168 */
169 std::wstring to_wstring(const ATL::CString& s);
170
171 /**
172 * Conversion function from std::wstring to ATL::CString
173 */
174 ATL::CString to_CString(const std::wstring& s);
OLDNEW
« 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