summaryrefslogtreecommitdiffstats
path: root/qmake/library/proitems.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-03 10:23:56 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-06-03 10:23:56 +0200
commite2f66f921594b7be4af4a058c959557489e86879 (patch)
treecc44931708b57bd5a761906797c7dee0360d1d6b /qmake/library/proitems.cpp
parent933bf178aab88ab5df8a68cbf02611d6d8744b1b (diff)
parent754efa57d89c62d1796e01b407e9222e67450f52 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
Diffstat (limited to 'qmake/library/proitems.cpp')
-rw-r--r--qmake/library/proitems.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/qmake/library/proitems.cpp b/qmake/library/proitems.cpp
index e780259417..a610da6b69 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()) {
@@ -473,4 +485,23 @@ ProFile::~ProFile()
{
}
+ProString ProFile::getStr(const ushort *&tPtr)
+{
+ uint len = *tPtr++;
+ ProString ret(items(), tPtr - tokPtr(), len);
+ ret.setSource(this);
+ tPtr += len;
+ return ret;
+}
+
+ProKey ProFile::getHashStr(const ushort *&tPtr)
+{
+ uint hash = *tPtr++;
+ hash |= (uint)*tPtr++ << 16;
+ uint len = *tPtr++;
+ ProKey ret(items(), tPtr - tokPtr(), len, hash);
+ tPtr += len;
+ return ret;
+}
+
QT_END_NAMESPACE