diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2019-12-21 00:53:25 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-01-08 13:07:12 +0200 |
commit | 08f03b1bbbf420ad866c08de250800bd793d3889 (patch) | |
tree | 746df1622697135575f432d619c8ad0dfd2902a8 /render-test/manifest_parser.cpp | |
parent | 502ddd3c8ab723664cc59957ce7190aafd2ee58f (diff) | |
download | qtlocation-mapboxgl-08f03b1bbbf420ad866c08de250800bd793d3889.tar.gz |
[render-test] Add cache database path to the manifest
A path relative to the manifest pointing at the data cache.
Diffstat (limited to 'render-test/manifest_parser.cpp')
-rw-r--r-- | render-test/manifest_parser.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/render-test/manifest_parser.cpp b/render-test/manifest_parser.cpp index 34be621a7f..6aec4b3593 100644 --- a/render-test/manifest_parser.cpp +++ b/render-test/manifest_parser.cpp @@ -44,6 +44,10 @@ const std::string& Manifest::getResultPath() const { return resultPath; } +const std::string& Manifest::getCachePath() const { + return cachePath; +} + const std::set<std::string>& Manifest::getProbes() const { return probes; } @@ -305,6 +309,18 @@ mbgl::optional<Manifest> ManifestParser::parseManifest(const std::string& manife return mbgl::nullopt; } } + if (document.HasMember("cache_path")) { + const auto& cachePathValue = document["cache_path"]; + if (!cachePathValue.IsString()) { + mbgl::Log::Warning( + mbgl::Event::General, "Invalid cache_path is provided inside the manifest file: %s", filePath.c_str()); + return mbgl::nullopt; + } + manifest.cachePath = (getValidPath(manifest.manifestPath, ".") / cachePathValue.GetString()).string(); + if (manifest.cachePath.empty()) { + return mbgl::nullopt; + } + } mbgl::filesystem::path baseTestPath; if (document.HasMember("base_test_path")) { const auto& testPathValue = document["base_test_path"]; |