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

QCanDbcFileParser: provide API to supply file contents as a QString

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0 FF
    • 6.6.0 Beta3
    • SerialBus: CAN Bus
    • None
    • All
    • 3
    • 9a6d4228d (dev), 85db6d6c0 (6.6), f8384dcac (tqtc/lts-6.5), 8f1167b9c (dev)
    • Foundations Sprint 94, Foundations Sprint 95

      After https://codereview.qt-project.org/c/qt/qtserialbus/+/486148 is merged, we expect the files to be encoded in UTF-8.

      However, the users report that it's not always the case. In practice the files can be provided in any encoding (e.g. Chinese GB 18030).

      The suggestion is to introduce an API that will be taking the file contents as a QString, so that the user could read the file and do all the encoding conversions in advance.

      Update: the internal parser operates on QStringView, so it makes sense to have a method signature like:

      bool QCanDbcFileParser::parseFromData(QStringView data);
      

      Probably even better approach would be to convert the internal parser to QAnyStringView, and then use it in the signature... But that requires at least QRegularExpression and friends to support QAnyStringView APIs, which is not the case as of now.

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

            ivan.solovev Ivan Solovev
            ivan.solovev Ivan Solovev
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: