Add display of cache sizes

sql-rework
Tomasz Goliński 2019-11-08 22:50:21 +01:00
rodzic ccf2ec1f28
commit 08464564ee
3 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -13,7 +13,7 @@ static float degtorad(float x) {
void Cache::show() const {
std::cout << "Cache:\t" << code << ' ' << name << " (type: " << type << ", owned by " << owner << ")\n";
std::cout << '\t' << pos.lat << " " << pos.lon << "\t\tD/T: " << diff << '/' << terr << "\t\tFound on " << date() << '\n';
std::cout << '\t' << pos.lat << " " << pos.lon << "\t\tD/T: " << diff << '/' << terr << "\t\tSize: " << size << "\t\tFound on " << date() << '\n';
}
std::string Cache::link() const {

Wyświetl plik

@ -307,6 +307,7 @@ int main(int argc, char** argv) {
if ((show_types || show_html) && !get_not_found) {
show_histogram(&cc, &Cache::type, "Cache types", show_html);
show_histogram(&cc, &Cache::size, "Cache sizes", show_html);
if (!show_html) show_histogram(&cc, &Cache::origin, "Services", 0);
show_histogram(&cc, &Cache::region, "Regions", show_html);
}

Wyświetl plik

@ -75,7 +75,7 @@ std::string Okapi::get_user_caches_json(std::string uuid, int count, int offset)
std::string Okapi::get_caches_json(std::string codes) {
std::string service = url + OKAPI_caches;
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region";
std::string query = "consumer_key=" + key + "&cache_codes=" + codes + "&fields=code|name|location|type|status|difficulty|terrain|owner|region|size2";
return curl_post(service, query);
}
@ -125,6 +125,7 @@ Caches Okapi::get_caches(std::vector<std::pair<std::string, std::tm>> codes) {
c.code = el.value()["code"];
c.name = el.value()["name"];
c.type = el.value()["type"];
c.size = el.value()["size2"];
c.region = el.value()["region"];
c.diff = el.value()["difficulty"];
c.terr = el.value()["terrain"];