Added raw pricing category

This commit is contained in:
VladiMihaylenko 2018-03-30 14:26:00 +03:00 committed by Arsentiy Milchakov
parent a001313025
commit c2c4ab6254
2 changed files with 15 additions and 0 deletions

View file

@ -257,6 +257,18 @@ string Info::GetApproximatePricing() const
return result;
}
boost::optional<int> Info::GetRawApproximatePricing() const
{
if (!IsSponsored())
return {};
int pricing;
if (strings::to_int(GetMetadata().Get(feature::Metadata::FMD_PRICE_RATE), pricing))
return pricing;
return {};
}
bool Info::HasBanner() const
{
if (!m_adsEngine)

View file

@ -27,6 +27,8 @@
#include <utility>
#include <vector>
#include <boost/optional.hpp>
namespace ads
{
struct Banner;
@ -107,6 +109,7 @@ public:
float GetRatingRawValue() const;
/// @returns string with |kPricingSymbol| signs or empty std::string if it isn't booking object
std::string GetApproximatePricing() const;
boost::optional<int> GetRawApproximatePricing() const;
/// UI setters
void SetCustomName(std::string const & name);