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

As a user of Qt and the STL, I'm missing an equivalent of find_first_of and find_first_not_of in Qt APIs

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • None

    Description

      I am tasked to make our base64 en/decoding routines available also to our Qt users in our company. That's easy enough, but then I wanted to port my test. In it, I need to limit the memory, so I don't want to keep an "expected" string in memory at the same time as the result of the test, so I'm basically doing

      std::vector<std::byte> input(2GiB + 1); // all NULs ...
      auto output = b64_enc(input);
      assert(output.size() == expectedSize);
      assert(std::string_view{output}.find_first_not_of('A'), std::string::npos); // ... encode to all-'A's
      

      But I couldn't find the equivalent of find_first_not_of in QByteArray. Ditto find_first_of.

      Please provide them.

      Attachments

        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