diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-03-06 21:14:17 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-28 13:02:58 +0000 |
commit | 40d48f86a077bda77670939074c7d7a3256d6951 (patch) | |
tree | cc0cc3c2d9abf7f75e78ffba2eeff8469164b66b /src/shared/proparser | |
parent | e3bee0dca92544e14ed2144e01d28286c0387624 (diff) |
add documentation for ProString::prepareExtend()
Change-Id: I6b520e8b505a2bfbb1e376fa72be0f140227a3a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
(cherry picked from qtbase/f37381e29246b5fc984aaff6cd07731c33b4e0df)
Diffstat (limited to 'src/shared/proparser')
-rw-r--r-- | src/shared/proparser/proitems.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/shared/proparser/proitems.cpp b/src/shared/proparser/proitems.cpp index 5ea3405fd32..6198df42773 100644 --- a/src/shared/proparser/proitems.cpp +++ b/src/shared/proparser/proitems.cpp @@ -156,6 +156,18 @@ QString &ProString::toQString(QString &tmp) const return tmp.setRawData(m_string.constData() + m_offset, m_length); } +/*! + * \brief ProString::prepareExtend + * \param extraLen number of new characters to be added + * \param thisTarget offset to which current contents should be moved + * \param extraTarget offset at which new characters will be added + * \return pointer to storage location for new characters + * + * Prepares the string for adding new characters. + * If the string is detached and has enough space, it will be changed in place. + * Otherwise, it will be replaced with a new string object, thus detaching. + * In either case, the hash will be reset. + */ QChar *ProString::prepareExtend(int extraLen, int thisTarget, int extraTarget) { if (m_string.isDetached() && m_length + extraLen <= m_string.capacity()) { |