Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120728

Port QUrl ctor/fromX to QAnyStringView

    XMLWordPrintable

Details

    Description

      QUrl doesn't store the QString url that its ctor and fromString()/fromUserInput()/etc take¹, but saves a parsed-down version, so it's a perfect candidate for porting to QAnyStringView. The implementation of Private::parse() is screaming "port me to a view" as it's passing QString + offset around to helper functions.

      Maybe we can use this opportunity to drop the UTF-16 in the implementation. URIs are more likely than not US-ASCII (certainly when percent-encoded), and given that Error is allocated lazily for memory reasons, using UTF-16 to hold the parsed components seems excessively laissez-faire.

      ¹ except in Error, but that's an error case, so shouldn't influence the design of the rest of the API.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              cnn Qt Core & Network
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes