Fix using different types

This commit is contained in:
Sergey Yershov 2016-04-12 14:30:29 +03:00
parent ad4d681fa5
commit 6c55581358
5 changed files with 12 additions and 11 deletions

View file

@ -1,6 +1,7 @@
#pragma once
#include "std/string.hpp"
#include "std/utility.hpp"
enum class MapOptions : uint8_t
{
@ -10,6 +11,10 @@ enum class MapOptions : uint8_t
MapWithCarRouting = 0x3
};
using TMwmCounter = uint32_t;
using TMwmSize = uint64_t;
using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>;
bool HasOptions(MapOptions mask, MapOptions options);
MapOptions IntersectOptions(MapOptions lhs, MapOptions rhs);

View file

@ -35,13 +35,13 @@ CountryFile::CountryFile(string const & name) : m_name(name), m_mapSize(0), m_ro
string const & CountryFile::GetName() const { return m_name; }
void CountryFile::SetRemoteSizes(uint32_t mapSize, uint32_t routingSize)
void CountryFile::SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize)
{
m_mapSize = mapSize;
m_routingSize = routingSize;
}
uint32_t CountryFile::GetRemoteSize(MapOptions filesMask) const
TMwmSize CountryFile::GetRemoteSize(MapOptions filesMask) const
{
uint32_t size = 0;
if (HasOptions(filesMask, MapOptions::Map))

View file

@ -20,8 +20,8 @@ public:
string const & GetName() const;
/// \note Remote size is size of mwm in bytes. This mwm contains routing and map sections.
void SetRemoteSizes(uint32_t mapSize, uint32_t routingSize);
uint32_t GetRemoteSize(MapOptions file) const;
void SetRemoteSizes(TMwmSize mapSize, TMwmSize routingSize);
TMwmSize GetRemoteSize(MapOptions file) const;
inline bool operator<(const CountryFile & rhs) const { return m_name < rhs.m_name; }
inline bool operator==(const CountryFile & rhs) const { return m_name == rhs.m_name; }
@ -32,8 +32,8 @@ private:
/// Base name (without any extensions) of the file. Same as id of country/region.
string m_name;
uint32_t m_mapSize;
uint32_t m_routingSize;
TMwmSize m_mapSize;
TMwmSize m_routingSize;
};
/// \returns This method returns file name with extension. For example Abkhazia.mwm or

View file

@ -136,7 +136,7 @@ public:
using TUpdateCallback = function<void(storage::TCountryId const &, TLocalFilePtr const)>;
using TDeleteCallback = function<bool(storage::TCountryId const &, TLocalFilePtr const)>;
using TChangeCountryFunction = function<void(TCountryId const &)>;
using TProgressFunction = function<void(TCountryId const &, TLocalAndRemoteSize const &)>;
using TProgressFunction = function<void(TCountryId const &, MapFilesDownloader::TProgress const &)>;
using TQueue = list<QueuedCountry>;
private:

View file

@ -63,10 +63,6 @@ namespace storage
};
string DebugPrint(StatusAndError statusAndError);
using TMwmCounter = uint32_t;
using TMwmSize = uint64_t;
using TLocalAndRemoteSize = pair<TMwmSize, TMwmSize>;
StatusAndError ParseStatus(Status innerStatus);
} // namespace storage