Opened 4 years ago

Last modified 22 months ago

#1234 new change

[Stop using ATL] Replace ATL::CString with std::wstring

Reported by: eric@… Assignee: eric@…
Priority: P4 Milestone: Adblock-Plus-for-Internet-Explorer-Next
Module: Adblock-Plus-for-Internet-Explorer Keywords:
Cc: oleksandr@… Blocked By:
Blocking: #276 Platform: Internet Explorer
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

http://codereview.adblockplus.org/6523237609504768/
http://codereview.adblockplus.org/6224768520945664/
http://codereview.adblockplus.org/4772743157383168/
http://codereview.adblockplus.org/5516878722105344/
http://codereview.adblockplus.org/5163396739629056/
http://codereview.adblockplus.org/4895405913407488/
http://codereview.adblockplus.org/6288156869525504/
http://codereview.adblockplus.org/4912420225024000/
http://codereview.adblockplus.org/5491870822039552/
http://codereview.adblockplus.org/5747779603267584/
https://codereview.adblockplus.org/5670602698391552/
https://codereview.adblockplus.org/5187613258416128/
https://codereview.adblockplus.org/29330625/
https://codereview.adblockplus.org/29330618/
https://codereview.adblockplus.org/29332057/
https://codereview.adblockplus.org/29331767/
https://codereview.adblockplus.org/29331055/
https://codereview.adblockplus.org/29332775/
https://codereview.adblockplus.org/29323611/
https://codereview.adblockplus.org/29347788/

Description

Background

We are using ATL::CString extensively. It offers no substantive advantages over std::wstring. Its use induces a lot of clutter in the form of not-very-necessary type conversions.

What to change

Replace all uses of CString with std::wstring. While not particularly technically difficult, there are a few complications.

  • There are a handful of CString member functions that don't have equivalents in wstring. These require replacement.
  • It's not possible to perform the conversion all at once. During the interim, we'll using explicit conversion functions that mark the boundary of progress for this change.
  • The logging functions for debug use CString at present but will require both wstring and string signatures after conversion. Most will use the wstring version, but std::exception::what() uses string. It's expedient to make a small exception here.

Change History (18)

comment:1 Changed 4 years ago by fhd

  • Priority changed from Unknown to P4
  • Ready set
  • Review URL(s) modified (diff)

comment:2 Changed 4 years ago by fhd

  • Summary changed from Replace ATL::CString with std::wstring to [Stop using ATL} Replace ATL::CString with std::wstring

comment:3 Changed 4 years ago by fhd

  • Summary changed from [Stop using ATL} Replace ATL::CString with std::wstring to [Stop using ATL] Replace ATL::CString with std::wstring

comment:4 Changed 4 years ago by eric@…

  • Review URL(s) modified (diff)

comment:5 Changed 4 years ago by oleksandr

  • Cc oleksandr@… added
  • Owner set to eric@…

comment:6 Changed 4 years ago by eric@…

  • Review URL(s) modified (diff)

comment:7 Changed 4 years ago by eric@…

  • Review URL(s) modified (diff)

comment:8 Changed 4 years ago by eric@…

  • Review URL(s) modified (diff)

comment:9 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)
  • Tester set to Unknown

comment:10 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:11 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:12 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:13 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:14 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:15 Changed 3 years ago by eric@…

  • Review URL(s) modified (diff)

comment:16 Changed 2 years ago by eric@…

  • Review URL(s) modified (diff)

As of the commit of https://codereview.adblockplus.org/29347788/, the only remaining uses of CString are in the threading code for deferred log writes.

comment:17 Changed 2 years ago by oleksandr

  • Milestone set to Adblock-Plus-for-Internet-Explorer-Next

comment:18 Changed 22 months ago by oleksandr

  • Milestone changed from Adblock-Plus-for-Internet-Explorer-1.6 to Adblock-Plus-for-Internet-Explorer-Next
Note: See TracTickets for help on using tickets.