diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2016-12-14 10:31:18 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2016-12-15 09:37:00 +0000 |
commit | dd761e0893ff457103237e8a76fe3fea276698cc (patch) | |
tree | 6ed3be5aa2d598ce2e0f9fb3d70d1115eb2763ce /src/lib/corelib/language/resolvedfilecontext.cpp | |
parent | 15f7a97650a8bce2ac2698bd189397260453e923 (diff) |
Fully templatize the PersistentPool class
The old implementation was a wild mix of templates, overloads and, worst
of all, implicit assumptions about the types of container items. This
combination made it close to impossible to add support for serializing
generic containers. Now we have a sensible interface that we can build
upon.
Change-Id: I82806eaf535c16fc861bededf1b06c681d2128c0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/language/resolvedfilecontext.cpp')
-rw-r--r-- | src/lib/corelib/language/resolvedfilecontext.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/corelib/language/resolvedfilecontext.cpp b/src/lib/corelib/language/resolvedfilecontext.cpp index 9dc7ede8c..dba5b5fde 100644 --- a/src/lib/corelib/language/resolvedfilecontext.cpp +++ b/src/lib/corelib/language/resolvedfilecontext.cpp @@ -52,15 +52,15 @@ ResolvedFileContext::ResolvedFileContext(const FileContextBase &ctx) void ResolvedFileContext::load(PersistentPool &pool) { - m_filePath = pool.idLoadString(); - m_jsExtensions = pool.idLoadStringList(); - m_searchPaths = pool.idLoadStringList(); + pool.load(m_filePath); + pool.load(m_jsExtensions); + pool.load(m_searchPaths); int count; pool.stream() >> count; for (int i = 0; i < count; ++i) { JsImport jsi; - jsi.scopeName = pool.idLoadString(); - jsi.filePaths = pool.idLoadStringList(); + pool.load(jsi.scopeName); + pool.load(jsi.filePaths); jsi.location.load(pool); m_jsImports << jsi; } @@ -68,13 +68,13 @@ void ResolvedFileContext::load(PersistentPool &pool) void ResolvedFileContext::store(PersistentPool &pool) const { - pool.storeString(m_filePath); - pool.storeStringList(m_jsExtensions); - pool.storeStringList(m_searchPaths); + pool.store(m_filePath); + pool.store(m_jsExtensions); + pool.store(m_searchPaths); pool.stream() << m_jsImports.count(); foreach (const JsImport &jsi, m_jsImports) { - pool.storeString(jsi.scopeName); - pool.storeStringList(jsi.filePaths); + pool.store(jsi.scopeName); + pool.store(jsi.filePaths); jsi.location.store(pool); } } |