40 {
"$Id: DAS.cc 24886 2011-09-13 22:58:35Z jimg $"
86 append_container(attr,
www2id(name));
104 return _container_name ;
117 if (cn != _container_name) {
125 _container_name = cn;
159 d_container->
erase();
255 FILE *in = fopen(fname.c_str(),
"r");
263 int res = fclose(in);
265 DBG(cerr <<
"DAS::parse - Failed to close file " << (
void *)in << endl ;) ;
283 FILE *in = fdopen(_dup(fd),
"r");
285 FILE *in = fdopen(dup(fd),
"r");
289 throw InternalErr(__FILE__, __LINE__,
"Could not access file.");
294 int res = fclose(in);
296 DBG(cerr <<
"DAS::parse(fd) - Failed to close " << (
void *)in << endl ;) ;
312 throw InternalErr(__FILE__, __LINE__,
"Null input stream.");
320 bool status =
dasparse((
void *) & arg) == 0;
326 if (!status || !arg.
status()) {
349 fprintf(out,
"Attributes {\n") ;
351 d_attrs.
print(out,
" ", dereference);
353 fprintf(out,
"}\n") ;
371 out <<
"Attributes {\n" ;
373 d_attrs.
print(out,
" ", dereference);
389 << (
void *)
this <<
")" << endl ;
std::vector< entry * >::iterator Attr_iter
virtual AttrTable * container()
Returns the current attribute container when multiple files used to build this DAS.
AttrTable * get_table(AttrTable::Attr_iter &i)
Returns the referenced variable attribute table.
void dasrestart(FILE *yyin)
virtual Attr_iter attr_end()
Contains the attributes for a dataset.
AttrTable::Attr_iter var_begin()
Returns a reference to the attribute table for the first variable.
virtual AttrTable * add_table(const string &name, AttrTable *at)
Adds a variable attribute table to the DAS or the current dataset container attribute table...
virtual void set_is_global_attribute(bool ga)
virtual void print(FILE *out, string pad=" ", bool dereference=false)
Prints the attribute table.
virtual string get_name() const
Get the name of this attribute table.
virtual void print(FILE *out, bool dereference=false)
A class for software fault reporting.
void * das_buffer(FILE *fp)
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
string get_name(AttrTable::Attr_iter &i)
Returns the name of the referenced variable attribute table.
virtual void erase()
Erase the attribute table.
virtual void erase()
erase all attributes in this DAS
virtual Attr_iter attr_begin()
string www2id(const string &in, const string &escape, const string &except)
AttrTable::Attr_iter var_end()
virtual void dump(ostream &strm) const
dumps information about this object
static ostream & LMarg(ostream &strm)
virtual void parse(string fname)
Reads a DAS from the named file.
void das_delete_buffer(void *buffer)
libdap base object for common functionality of libdap objects
Pass parameters by reference to a parser.
virtual ~DAS()
This deletes the pointers to AttrTables allocated during the parse (and at other times). jhrg 7/29/94.
virtual void dump(ostream &strm) const
dumps information about this object
void das_switch_to_buffer(void *new_buffer)
A class for error processing.
virtual unsigned int get_size() const
Returns the number of attributes in the current attribute table.
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
virtual string container_name()
Returns the name of the current attribute container when multiple files used to build this DAS...