GeoLite2++  v0.0.1-2711
C++ API for MaxMind's GeoLite2 Database
Looking for a senior C++ dev? I'm looking for work. Hire me!
GeoLite2++
Author
Stéphane Charette, steph.nosp@m.anec.nosp@m.haret.nosp@m.te@g.nosp@m.mail..nosp@m.com
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";
GeoLite2PP::DB db( database_filename );
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" } } ]
}