forked from lthn/blockchain
disabled boost locale for ios
This commit is contained in:
parent
fbc50419db
commit
3331e419e5
4 changed files with 9 additions and 9 deletions
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "include_base_utils.h"
|
#include "include_base_utils.h"
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
#include <boost/locale.hpp>
|
#include <boost/locale.hpp>
|
||||||
#endif
|
#endif
|
||||||
using namespace epee;
|
using namespace epee;
|
||||||
|
|
@ -3208,7 +3208,7 @@ namespace currency
|
||||||
return o << "<" << r.n << ":" << r.tx_id << ">";
|
return o << "<" << r.n << ":" << r.tx_id << ">";
|
||||||
}
|
}
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
const std::locale& utf8_get_conversion_locale()
|
const std::locale& utf8_get_conversion_locale()
|
||||||
{
|
{
|
||||||
static std::locale loc = boost::locale::generator().generate("en_US.UTF-8");
|
static std::locale loc = boost::locale::generator().generate("en_US.UTF-8");
|
||||||
|
|
|
||||||
|
|
@ -743,7 +743,7 @@ namespace currency
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
std::ostream& operator <<(std::ostream& o, const ref_by_id& r);
|
std::ostream& operator <<(std::ostream& o, const ref_by_id& r);
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
std::string utf8_to_upper(const std::string& s);
|
std::string utf8_to_upper(const std::string& s);
|
||||||
std::string utf8_to_lower(const std::string& s);
|
std::string utf8_to_lower(const std::string& s);
|
||||||
bool utf8_substring_test_case_insensitive(const std::string& match, const std::string& s); // Returns true is 's' contains 'match' (case-insensitive)
|
bool utf8_substring_test_case_insensitive(const std::string& match, const std::string& s); // Returns true is 's' contains 'match' (case-insensitive)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ namespace bc_services
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
bool order_offers_by_name(const offer_details_ex* a, const offer_details_ex* b)
|
bool order_offers_by_name(const offer_details_ex* a, const offer_details_ex* b)
|
||||||
{
|
{
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
return currency::utf8_to_lower(a->target) < currency::utf8_to_lower(b->target);
|
return currency::utf8_to_lower(a->target) < currency::utf8_to_lower(b->target);
|
||||||
#else
|
#else
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -150,7 +150,7 @@ namespace bc_services
|
||||||
//check category
|
//check category
|
||||||
if (!of.category.empty() && o.category.find(of.category) == std::string::npos)
|
if (!of.category.empty() && o.category.find(of.category) == std::string::npos)
|
||||||
return false;
|
return false;
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
//check target condition
|
//check target condition
|
||||||
if (of.target.size() && !currency::utf8_substring_test_case_insensitive(of.target, o.target))
|
if (of.target.size() && !currency::utf8_substring_test_case_insensitive(of.target, o.target))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -173,7 +173,7 @@ namespace bc_services
|
||||||
//check target condition
|
//check target condition
|
||||||
if (of.location_country.size() && (of.location_country != o.location_country))
|
if (of.location_country.size() && (of.location_country != o.location_country))
|
||||||
return false;
|
return false;
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
//check target condition
|
//check target condition
|
||||||
if (of.location_city.size() && !currency::utf8_substring_test_case_insensitive(of.location_city, o.location_city))
|
if (of.location_city.size() && !currency::utf8_substring_test_case_insensitive(of.location_city, o.location_city))
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -221,7 +221,7 @@ namespace bc_services
|
||||||
//--------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------
|
||||||
bool filter_offers_list(std::list<bc_services::offer_details_ex>& offers, const bc_services::core_offers_filter& filter, uint64_t current_core_time)
|
bool filter_offers_list(std::list<bc_services::offer_details_ex>& offers, const bc_services::core_offers_filter& filter, uint64_t current_core_time)
|
||||||
{
|
{
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
//filter
|
//filter
|
||||||
offers.remove_if([&](bc_services::offer_details_ex& o) -> bool {
|
offers.remove_if([&](bc_services::offer_details_ex& o) -> bool {
|
||||||
return !is_offer_matched_by_filter(o, filter, current_core_time);
|
return !is_offer_matched_by_filter(o, filter, current_core_time);
|
||||||
|
|
|
||||||
|
|
@ -193,14 +193,14 @@ namespace bc_services
|
||||||
inline std::string extract_contacts(const odeh& v) { return v.contacts; }
|
inline std::string extract_contacts(const odeh& v) { return v.contacts; }
|
||||||
inline std::string extract_location(const odeh& v) {
|
inline std::string extract_location(const odeh& v) {
|
||||||
|
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
return currency::utf8_to_lower(v.location_country + v.location_city);
|
return currency::utf8_to_lower(v.location_country + v.location_city);
|
||||||
#else
|
#else
|
||||||
return "UNSUPORTED";
|
return "UNSUPORTED";
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
inline std::string extract_name(const odeh& v) {
|
inline std::string extract_name(const odeh& v) {
|
||||||
#ifndef ANDROID_BUILD
|
#ifndef MOBILE_WALLET_BUILD
|
||||||
return currency::utf8_to_lower(v.target);
|
return currency::utf8_to_lower(v.target);
|
||||||
#else
|
#else
|
||||||
return "UNSUPORTED";
|
return "UNSUPORTED";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue