diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-03-06 21:14:17 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-05-20 18:11:08 +0000 |
commit | f37381e29246b5fc984aaff6cd07731c33b4e0df (patch) | |
tree | 9ce18c1ef4fbe6ba997bf7e39be5f35a4fe6e255 /qmake | |
parent | a3fac538645e0c672ac7c8d5e86f8cfbb1ec8426 (diff) |
add autotest for ProString
also adds documentation, which is kind of a sanity test. ehm.
Change-Id: I6b520e8b505a2bfbb1e376fa72be0f140227a3a4
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/library/proitems.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp index e780259417..f3526846e9 100644 --- a/qmake/library/proitems.cpp +++ b/qmake/library/proitems.cpp @@ -159,6 +159,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()) { |