diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-05-03 20:11:34 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-05-16 09:34:54 +0000 |
commit | 51e1374bae4ae449b04ddeb30c14bc67935705ca (patch) | |
tree | e343cd5056c1d06f09fd8c346435b4949f554a63 /src/corelib/tools/qstring.cpp | |
parent | 3c592a17f1b54c88a0d868b7251f5134dac421b6 (diff) |
QLatin1String: add constructor from pointer pair
This is often more natural than (ptr, len), and I need it in the
implementation of QLatin1String::trimmed().
[ChangeLog][QtCore][QLatin1String] Added a constructor taking two
pointers, complementing the constructor that takes a pointer and a
length.
Change-Id: I0606fa0e3f820af1c3c1e261a340e5a941443e4f
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index bfa6fb63b5..a6295da45e 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -8792,6 +8792,24 @@ QString &QString::setRawData(const QChar *unicode, int size) \sa latin1() */ +/*! + \fn QLatin1String::QLatin1String(const char *first, const char *last) + \since 5.10 + + Constructs a QLatin1String object that stores \a first with length + (\a last - \a first). + + The range \c{[first,last)} must remain valid for the lifetime of + this Latin-1 string object. + + Passing \c nullptr as \a first is safe if \a last is \c nullptr, + too, and results in a null Latin-1 string. + + The behavior is undefined if \a last precedes \a first, \a first + is \c nullptr and \a last is not, or if \c{last - first > + INT_MAX}. +*/ + /*! \fn QLatin1String::QLatin1String(const QByteArray &str) Constructs a QLatin1String object that stores \a str. |