108AttrType String_to_AttrType(
const string &s);
172 bool is_utf8_str =
false;
176 AttrTable *attributes;
177 std::vector<string> *attr;
179 entry(): name(
""), type(Attr_unknown), is_alias(
false),
180 aliased_to(
""), is_global(
true), attributes(0), attr(0) {}
182 entry(
const entry &rhs): name(rhs.name), type(rhs.type), is_alias(rhs.is_alias),
183 aliased_to(rhs.aliased_to), is_global(rhs.is_global),attributes(0), attr(0)
192 if (type == Attr_container) {
193 delete attributes; attributes = 0;
196 delete attr; attr = 0;
205 void clone(
const entry &rhs)
210 is_alias = rhs.is_alias;
211 aliased_to = rhs.aliased_to;
212 is_global = rhs.is_global;
217 case Attr_container: {
219 attributes = rhs.attributes;
221 attributes =
new AttrTable(*rhs.attributes);
228 attr =
new std::vector<string>(*rhs.attr);
234 entry &operator=(
const entry &rhs)
249 bool is_dap4_type(
const std::string &path, std::vector<std::string> &inventory)
const
251 bool ima_d4_attr =
false;
259 ima_d4_attr = attributes->has_dap4_types(path ,inventory);
269 typedef std::vector<entry *>::const_iterator Attr_citer ;
270 typedef std::vector<entry *>::iterator Attr_iter ;
275 std::vector<entry *> attr_map;
283 bool d_is_global_attribute;
285 void delete_attr_table();
287 friend class AttrTableTest;
294 void simple_print(ostream &out,
string pad, Attr_iter i,
303 virtual void erase();
305 virtual unsigned int get_size()
const;
307 virtual void set_name(
const string &n);
317 virtual bool is_global_attribute()
const {
return d_is_global_attribute; }
318 virtual void set_is_global_attribute(
bool ga) { d_is_global_attribute = ga; }
320 virtual unsigned int append_attr(
const string &name,
const string &type,
321 const string &value);
322 virtual unsigned int append_attr(
const string &name,
const string &type,
323 vector<string> *values);
324 virtual unsigned int append_attr(
const string &name,
const string &type,
325 const string &value,
bool is_utf8_str);
326 virtual unsigned int append_attr(
const string &name,
const string &type,
327 vector<string> *values,
bool is_utf8_str);
333 virtual void find(
const string &target, AttrTable **at, Attr_iter *iter);
336 Attr_iter *location);
339 AttrTable *simple_find_container(
const string &target);
343 virtual string get_type(
const string &name);
346 virtual string get_attr(
const string &name,
unsigned int i = 0);
348 virtual void del_attr(
const string &name,
int i = -1);
353 virtual string get_name(Attr_iter iter);
357 virtual string get_type(Attr_iter iter);
360 virtual string get_attr(Attr_iter iter,
unsigned int i = 0);
362 virtual bool is_global_attribute(Attr_iter iter);
363 virtual void set_is_global_attribute(Attr_iter iter,
bool ga);
367 const string &source);
371 virtual bool attr_alias(
const string &alias,
const string &name);
373 bool has_dap4_types(
const std::string &path, std::vector<std::string> &inventory)
const;
374 bool is_dap4_type(
const std::string &path, std::vector<std::string> &inventory)
const;
376 virtual void print(FILE *out,
string pad =
" ",
377 bool dereference =
false);
378 virtual void print(ostream &out,
string pad =
" ",
379 bool dereference =
false);
381 virtual void print_xml(FILE *out,
string pad =
" ",
382 bool constrained =
false);
383 virtual void print_xml(ostream &out,
string pad =
" ",
384 bool constrained =
false);
390 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.
bool has_dap4_types(const std::string &path, std::vector< std::string > &inventory) const
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)
bool is_dap4_type(const std::string &path, std::vector< std::string > &inventory) const