Welcome to mirror list, hosted at ThFree Co, Russian Federation.

storage_helpers.hpp « storage - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d0593742c9d86b1e9123f7c9b7bc942ccc5136e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once

#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"

#include "platform/country_defines.hpp"

#include "storage/index.hpp"
#include "storage/storage_defines.hpp"

namespace storage
{
class CountryInfoGetter;
class Storage;

TMwmSize constexpr kMaxMwmSizeBytes = 100 /*Mb*/ * 1024 * 1024;

/// \returns true if |position| is covered by a downloaded mwms and false otherwise.
/// \note |position| has coordinates in mercator.
/// \note This method takes into acount only maps enumerated in countries.txt.
bool IsPointCoveredByDownloadedMaps(m2::PointD const & position,
                                    Storage const & storage,
                                    CountryInfoGetter const & countryInfoGetter);

bool IsDownloadFailed(Status status);

bool IsEnoughSpaceForDownload(TMwmSize size);
bool IsEnoughSpaceForDownload(TCountryId const & countryId, Storage const & storage);
bool IsEnoughSpaceForUpdate(TCountryId const & countryId, Storage const & storage);


/// \brief Calculates limit rect for |countryId| (expandable or not).
/// \returns bounding box in mercator coordinates.
m2::RectD CalcLimitRect(TCountryId const & countryId,
                        Storage const & storage,
                        CountryInfoGetter const & countryInfoGetter);
} // namespace storage