29#include "nlohmann/json.hpp"
38using json = nlohmann::json;
40#define prolog string("Provider::").append(__func__).append("() - ")
137string Provider::id()
const{
139 return json.get_str_if_present(CMR_PROVIDER_ID_KEY, d_provider_json_obj);
142string Provider::description_of_holding()
const {
144 return json.get_str_if_present(CMR_DESCRIPTION_OF_HOLDING_KEY, d_provider_json_obj);
147void Provider::get_collections(std::map<std::string,unique_ptr<cmr::Collection>> &collections)
const
150 cmrApi.get_collections(
id(), collections);
153void Provider::get_opendap_collections(std::map<std::string, std::unique_ptr<cmr::Collection>> &collections)
const
156 cmrApi.get_opendap_collections(
id(), collections);
162string Provider::to_string(
bool show_json)
const {
164 msg <<
"# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #" << endl;
165 msg <<
"# Provider" << endl;
166 msg <<
"# provider_id: " << id() << endl;
167 msg <<
"# description_of_holding: " << description_of_holding() << endl;
168 msg <<
"# OPeNDAP collection count: " << d_opendap_collection_count << endl;
171 msg <<
"# json: " << endl;
172 msg << d_provider_json_obj.dump(4) << endl;