diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qstring.cpp | 13 | ||||
-rw-r--r-- | src/corelib/tools/qstring.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 1b6ff3c5df..4e5d806dbb 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -7164,6 +7164,19 @@ QString &QString::setRawData(const QChar *unicode, int size) \sa latin1() */ +/*! \fn QLatin1String::QLatin1String(const char *str, int size) + + Constructs a QLatin1String object that stores \a str with \a size. + Note that if \a str is 0, an empty string is created; this case + is handled by QString. + + The string data is \e not copied. The caller must be able to + guarantee that \a str will not be deleted or modified as long as + the QLatin1String object exists. + + \sa latin1() +*/ + /*! \fn const char *QLatin1String::latin1() const Returns the Latin-1 string stored in this object. diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 9d92f403eb..f2d1de9c00 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -646,6 +646,7 @@ class QLatin1String { public: Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s) : m_size(s ? int(strlen(s)) : 0), m_data(s) {} + Q_DECL_CONSTEXPR inline explicit QLatin1String(const char *s, int size) : m_size(size), m_data(s) {} inline const char *latin1() const { return m_data; } inline int size() const { return m_size; } |