-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
QTest::toString(QCbor-type): port from const char* to unique_ptr<char[]>
This is more robust and lessens the impedance mismatch as seen by the old code using std::unique_ptr<char[]>(expr).get(). The new code isn't impedance-mismatch-free, either (UP{qstrdup(qba.data())}), but short of writing a small string class whose internal buffer can be release()ed to comply with the archaic QTest::toString() new[]'ed const char* return value, there's not much we can do about it atm. Also separate the internal from the "public" stuff in QCborValueFormatter by adding private: and public: sections. Change-Id: I09a2ad1a75bb9eab3d01f2b5b60afc2d762da384 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit d9264ee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 5e6fa3d)
- Loading branch information
Showing
1 changed file
with
36 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters