diff options
author | vng <viktor.govako@gmail.com> | 2014-10-08 19:23:23 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:29:46 +0300 |
commit | 6defa5228a6768d54824460c1582da71371783e1 (patch) | |
tree | 9f31d129dfd787e1e0136b8cd629d1d563f0df04 /storage/country.hpp | |
parent | b7c53102fb0e32ca343a7e782ceb1c2b2a26bf0a (diff) |
[storage] Do download .routing file.
Diffstat (limited to 'storage/country.hpp')
-rw-r--r-- | storage/country.hpp | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/storage/country.hpp b/storage/country.hpp index 1faa970995..a62870ed81 100644 --- a/storage/country.hpp +++ b/storage/country.hpp @@ -19,19 +19,29 @@ namespace update { class SizeUpdater; } namespace storage { /// Information about each file for a country - struct CountryFile + class CountryFile { - CountryFile() : m_remoteSize(0) {} - CountryFile(string const & fName, uint32_t remoteSize) - : m_fileName(fName), m_remoteSize(remoteSize) {} + string m_fileName; /// Same as id of country\region. + uint32_t m_mapSize, m_routingSize; - string GetFileWithExt() const { return m_fileName + DATA_FILE_EXTENSION; } - string const & GetFileWithoutExt() const { return m_fileName; } + public: + CountryFile() {} + CountryFile(string const & fName, uint32_t mapSize, uint32_t routingSize) + : m_fileName(fName), m_mapSize(mapSize), m_routingSize(routingSize) + { + } - uint32_t GetFileSize() const; + void AssignSizes(uint32_t mapSize, uint32_t routingSize) + { + m_mapSize = mapSize; + m_routingSize = routingSize; + } - string m_fileName; /// Same as id of country\region. - uint32_t m_remoteSize; + string GetFileWithExt(TMapOptions opt) const; + string const & GetFileWithoutExt() const { return m_fileName; } + + uint32_t GetFileSize(TMapOptions opt) const; + uint32_t GetRemoteSize(TMapOptions opt) const; }; typedef buffer_vector<CountryFile, 1> FilesContainerT; @@ -79,7 +89,7 @@ namespace storage /// @return bounds for downloaded parts of the country or empty rect //m2::RectD Bounds() const; - LocalAndRemoteSizeT Size() const; + LocalAndRemoteSizeT Size(TMapOptions opt) const; }; typedef SimpleTree<Country> CountriesContainerT; |