97AttrType String_to_AttrType(
const string &s);
164 std::vector<string> *attr;
166 entry(): name(
""), type(Attr_unknown), is_alias(
false),
167 aliased_to(
""), is_global(
true), attributes(0), attr(0) {}
169 entry(
const entry &rhs): name(rhs.name), type(rhs.type), is_alias(rhs.is_alias),
170 aliased_to(rhs.aliased_to), is_global(rhs.is_global),attributes(0), attr(0)
179 if (type == Attr_container) {
180 delete attributes; attributes = 0;
183 delete attr; attr = 0;
192 void clone(
const entry &rhs)
197 is_alias = rhs.is_alias;
198 aliased_to = rhs.aliased_to;
199 is_global = rhs.is_global;
204 case Attr_container: {
206 attributes = rhs.attributes;
208 attributes =
new AttrTable(*rhs.attributes);
215 attr =
new std::vector<string>(*rhs.attr);
231 typedef std::vector<entry *>::const_iterator Attr_citer ;
232 typedef std::vector<entry *>::iterator Attr_iter ;
237 std::vector<entry *> attr_map;
245 bool d_is_global_attribute;
247 void delete_attr_table();
249 friend class AttrTableTest;
256 void simple_print(ostream &out,
string pad, Attr_iter i,
265 virtual void erase();
267 virtual unsigned int get_size()
const;
269 virtual void set_name(
const string &n);
279 virtual bool is_global_attribute()
const {
return d_is_global_attribute; }
280 virtual void set_is_global_attribute(
bool ga) { d_is_global_attribute = ga; }
282 virtual unsigned int append_attr(
const string &name,
const string &type,
283 const string &value);
284 virtual unsigned int append_attr(
const string &name,
const string &type,
285 vector<string> *values);
290 virtual void find(
const string &target, AttrTable **at, Attr_iter *iter);
293 Attr_iter *location);
296 AttrTable *simple_find_container(
const string &target);
300 virtual string get_type(
const string &name);
303 virtual string get_attr(
const string &name,
unsigned int i = 0);
305 virtual void del_attr(
const string &name,
int i = -1);
310 virtual string get_name(Attr_iter iter);
314 virtual string get_type(Attr_iter iter);
317 virtual string get_attr(Attr_iter iter,
unsigned int i = 0);
319 virtual bool is_global_attribute(Attr_iter iter);
320 virtual void set_is_global_attribute(Attr_iter iter,
bool ga);
324 const string &source);
328 virtual bool attr_alias(
const string &alias,
const string &name);
330 virtual void print(FILE *out,
string pad =
" ",
331 bool dereference =
false);
332 virtual void print(ostream &out,
string pad =
" ",
333 bool dereference =
false);
335 virtual void print_xml(FILE *out,
string pad =
" ",
336 bool constrained =
false);
337 virtual void print_xml(ostream &out,
string pad =
" ",
338 bool constrained =
false);
344 virtual void dump(ostream &strm)
const ;
Contains the attributes for a dataset.
virtual AttrTable * append_container(const string &name)
Add a container to the attribute table.
void simple_print(FILE *out, string pad, Attr_iter i, bool dereference)
virtual unsigned int get_attr_num(const string &name)
Get the number of attributes in this container.
virtual bool attr_alias(const string &alias, AttrTable *at, const string &name)
Adds an alias to the set of attributes.
virtual bool is_container(Attr_iter iter)
virtual void find(const string &target, AttrTable **at, Attr_iter *iter)
virtual void set_name(const string &n)
Set the name of this attribute table.
virtual AttrTable * get_attr_table(const string &name)
Get an attribute container.
void clone(const AttrTable &at)
virtual Attr_iter attr_end()
virtual void print_xml(FILE *out, string pad=" ", bool constrained=false)
virtual AttrTable * get_parent() const
virtual string get_type(const string &name)
Get the type name of an attribute within this attribute table.
virtual vector< string > * get_attr_vector(const string &name)
Get a vector-valued attribute.
virtual void add_value_alias(AttrTable *at, const string &name, const string &source)
Add an alias for an attribute.
virtual unsigned int append_attr(const string &name, const string &type, const string &value)
Add an attribute to the table.
virtual Attr_iter attr_begin()
virtual Attr_iter get_attr_iter(int i)
void print_dap4(XMLWriter &xml)
virtual void del_attr(const string &name, int i=-1)
Deletes an attribute.
virtual string get_name() const
Get the name of this attribute table.
virtual void erase()
Erase the attribute table.
void print_xml_writer(XMLWriter &xml)
virtual Attr_iter del_attr_table(Attr_iter iter)
virtual void print(FILE *out, string pad=" ", bool dereference=false)
Prints the attribute table.
virtual void add_container_alias(const string &name, AttrTable *src)
Add an alias to a container held by this attribute table.
virtual unsigned int get_size() const
Get the number of entries in this attribute table.
virtual void dump(ostream &strm) const
dumps information about this object
virtual AttrTable * find_container(const string &target)
Find an attribute with a given name.
Attr_iter simple_find(const string &target)
virtual AttrType get_attr_type(const string &name)
Get the type of an attribute.
virtual AttrTable * recurrsive_find(const string &target, Attr_iter *location)
libdap base object for common functionality of libdap objects
top level DAP object to house generic methods
string add_space_encoding(const string &s)
string AttrType_to_String(const AttrType at)
string remove_space_encoding(const string &s)