| 1812 | |
| 1813 | private: |
| 1814 | void writeMetadata() |
| 1815 | { |
| 1816 | using namespace ItemRepositoryUtils; |
| 1817 | |
| 1818 | Q_ASSERT(m_file); |
| 1819 | Q_ASSERT(m_dynamicFile); |
| 1820 | |
| 1821 | m_file->seek(0); |
| 1822 | writeValue(m_file, m_repositoryVersion); |
| 1823 | uint hashSize = bucketHashSize; |
| 1824 | writeValue(m_file, hashSize); |
| 1825 | uint itemRepositoryVersion = staticItemRepositoryVersion(); |
| 1826 | writeValue(m_file, itemRepositoryVersion); |
| 1827 | writeValue(m_file, m_statBucketHashClashes); |
| 1828 | writeValue(m_file, m_statItemCount); |
| 1829 | |
| 1830 | const uint bucketCount = static_cast<uint>(m_buckets.size()); |
| 1831 | writeValue(m_file, bucketCount); |
| 1832 | writeValue(m_file, m_currentBucket); |
| 1833 | writeValues(m_file, bucketHashSize, m_firstBucketForHash); |
| 1834 | Q_ASSERT(m_file->pos() == BucketStartOffset); |
| 1835 | |
| 1836 | m_dynamicFile->seek(0); |
| 1837 | writeValue(m_dynamicFile, static_cast<uint>(m_freeSpaceBuckets.size())); |
| 1838 | writeList(m_dynamicFile, m_freeSpaceBuckets); |
| 1839 | |
| 1840 | Q_ASSERT(m_buckets.size() == m_monsterBucketTailMarker.size()); |
| 1841 | writeList(m_dynamicFile, m_monsterBucketTailMarker); |
| 1842 | } |
| 1843 | |
| 1844 | ///Synchronizes the state on disk to the one in memory, and does some memory-management. |
| 1845 | ///Should be called on a regular basis. Can be called centrally from the global item repository registry. |
nothing calls this directly
no test coverage detected