[omim] Changed getting mwm's info logic.

This commit is contained in:
VladiMihaylenko 2016-03-24 11:37:01 +03:00
parent 9cd62d4b14
commit 7cb421155f
2 changed files with 16 additions and 9 deletions

View file

@ -21,12 +21,18 @@ string DebugPrint(feature::EGeomType type)
}
}
pair<FeatureID::MwmName, FeatureID::MwmVersion> FeatureID::GetMwmNameAndVersion() const
{
if (!IsValid())
return {"INVALID", 0};
// static
char const * const FeatureID::kInvalidFileName = "INVALID";
// static
int64_t const FeatureID::kInvalidMwmVersion = -1;
auto const & mwmInfo = m_mwmId.GetInfo();
return {mwmInfo->GetCountryName(), mwmInfo->GetVersion()};
string FeatureID::GetMwmName() const
{
return IsValid() ? m_mwmId.GetInfo()->GetCountryName() : kInvalidFileName;
}
int64_t FeatureID::GetMwmVersion() const
{
return IsValid() ? m_mwmId.GetInfo()->GetVersion() : kInvalidMwmVersion;
}

View file

@ -22,8 +22,8 @@ string DebugPrint(feature::EGeomType type);
struct FeatureID
{
using MwmName = string;
using MwmVersion = int64_t;
static char const * const kInvalidFileName;
static int64_t const kInvalidMwmVersion;
MwmSet::MwmId m_mwmId;
uint32_t m_index;
@ -48,7 +48,8 @@ struct FeatureID
inline bool operator!=(FeatureID const & r) const { return !(*this == r); }
pair<MwmName, MwmVersion> GetMwmNameAndVersion() const;
string GetMwmName() const;
int64_t GetMwmVersion() const;
friend string DebugPrint(FeatureID const & id);
};