33#include "AISExceptions.h"
52 if (res.find(
"http:") == 0 || res.find(
"file:") == 0 || res.find(
"https:") == 0) {
53 return d_http.fetch_url(res);
55 FILE *s = fopen(res.c_str(),
"r");
57 throw Error(
"I could not open local AIS resource '" + res +
"'.");
76 if (!d_ais_db.has_resource(primary))
80 ResourceVector rv = d_ais_db.get_resource(primary);
82 for (ResourceVectorIter i = rv.begin(); i != rv.end(); ++i) {
84 switch (i->get_rule()) {
85 case Resource::overwrite:
86 das.
parse(ais_resource->get_stream());
88 case Resource::replace:
90 das.
parse(ais_resource->get_stream());
92 case Resource::fallback:
94 das.
parse(ais_resource->get_stream());
virtual void merge(const string &primary, DAS &das)
virtual Response * get_ais_resource(const string &res)
Hold attribute data for a DAP2 dataset.
virtual unsigned int get_size() const
Returns the number of attributes in the current attribute table.
virtual void parse(string fname)
Reads a DAS from the named file.
virtual void erase()
erase all attributes in this DAS
A class for error processing.
std::string get_error_message() const
A class for software fault reporting.
top level DAP object to house generic methods