- Author
- Stéphane Charette, steph.nosp@m.anec.nosp@m.haret.nosp@m.te@g.nosp@m.mail..nosp@m.com
- Copyright
- (C) 2016-2018 Stéphane Charette
- See also
- • Official Documentation
-
• Download GeoLite2++
-
•
license.txt
-
• Usage
Example C++:
#include <GeoLite2PP.hpp>
std::string database_filename = "/opt/my_project_files/GeoLite2-City.mmdb";
std::string json = db.
lookup(
"65.44.217.6" );
std::cout << json << std::endl;
Example output:
{ "city" : { "names" : { "en" : "Fresno" } },
"continent" : { "code" : "NA", "names" : { "en" : "North America" } },
"country" : { "iso_code" : "US", "names" : { "en" : "United States" } },
"location" : { "accuracy_radius" : 200,
"latitude" : 36.6055,
"longitude" : -119.752,
"time_zone" : "America/Los_Angeles" },
"postal" : { "code" : "93725" },
"subdivisions" : [ { "iso_code" : "CA", "names" : { "en" : "California" } } ]
}