break;
case GeoIPInterface::Location:
double lat = 0, lon = 0;
- boost::optional<int> alt, prec;
+ std::optional<int> alt;
+ std::optional<int> prec;
if (addr.isIPv6())
found = gi->queryLocationV6(gl, ip, lat, lon, alt, prec);
else
}
static bool queryGeoLocation(const Netmask& addr, GeoIPNetmask& gl, double& lat, double& lon,
- boost::optional<int>& alt, boost::optional<int>& prec)
+ std::optional<int>& alt, std::optional<int>& prec)
{
for (auto const& gi : s_geoip_files) {
string val;
string GeoIPBackend::format2str(string sformat, const Netmask& addr, GeoIPNetmask& gl, const GeoIPDomain& dom)
{
string::size_type cur, last;
- boost::optional<int> alt, prec;
+ std::optional<int> alt;
+ std::optional<int> prec;
double lat, lon;
time_t t = time(nullptr);
GeoIPNetmask tmp_gl; // largest wins
bool queryLocationV6(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& /* alt */, boost::optional<int>& /* prec */) override
+ std::optional<int>& /* alt */, std::optional<int>& /* prec */) override
{
if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0_V6 || d_db_type == GEOIP_CITY_EDITION_REV1_V6) {
std::unique_ptr<GeoIPRecord, geoiprecord_deleter> gir(GeoIP_record_by_addr_v6(d_gi.get(), ip.c_str()));
bool queryLocation(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& /* alt */, boost::optional<int>& /* prec */) override
+ std::optional<int>& /* alt */, std::optional<int>& /* prec */) override
{
if (d_db_type == GEOIP_REGION_EDITION_REV0 || d_db_type == GEOIP_REGION_EDITION_REV1 || d_db_type == GEOIP_CITY_EDITION_REV0 || d_db_type == GEOIP_CITY_EDITION_REV1) {
std::unique_ptr<GeoIPRecord, geoiprecord_deleter> gir(GeoIP_record_by_addr(d_gi.get(), ip.c_str()));
bool queryLocation(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& /* alt */, boost::optional<int>& prec) override
+ std::optional<int>& /* alt */, std::optional<int>& prec) override
{
MMDB_entry_data_s data;
MMDB_lookup_result_s res;
bool queryLocationV6(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& /* alt */, boost::optional<int>& prec) override
+ std::optional<int>& /* alt */, std::optional<int>& prec) override
{
MMDB_entry_data_s data;
MMDB_lookup_result_s res;
virtual bool queryCityV6(string& ret, GeoIPNetmask& gl, const string& ip) = 0;
virtual bool queryLocation(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& alt, boost::optional<int>& prec)
+ std::optional<int>& alt, std::optional<int>& prec)
= 0;
virtual bool queryLocationV6(GeoIPNetmask& gl, const string& ip,
double& latitude, double& longitude,
- boost::optional<int>& alt, boost::optional<int>& prec)
+ std::optional<int>& alt, std::optional<int>& prec)
= 0;
virtual ~GeoIPInterface() = default;