51#define NEW_DEL_ATTR_TABLE_BEHAVIOR 0
63 string::size_type pos = s.find(
"%20");
64 if (pos != string::npos) {
67 n.replace(pos, 3,
" ");
69 }
while (pos != string::npos);
80 string::size_type pos = s.find(
" ");
81 if (pos != string::npos) {
84 n.replace(pos, 1,
"%20");
86 }
while (pos != string::npos);
133 return "Enumeration";
141AttrType String_to_AttrType(
const string &s)
146 if (s2 ==
"container")
147 return Attr_container;
148 else if (s2 ==
"byte")
150 else if (s2 ==
"int16")
152 else if (s2 ==
"uint16")
154 else if (s2 ==
"int32")
156 else if (s2 ==
"uint32")
158 else if (s2 ==
"float32")
160 else if (s2 ==
"float64")
162 else if (s2 ==
"string")
164 else if (s2 ==
"url")
166 else if (s2 ==
"otherxml")
167 return Attr_other_xml;
170 else if (s2 ==
"int8")
172 else if (s2 ==
"uint8")
174 else if (s2 ==
"int64")
176 else if (s2 ==
"uint64")
178 else if (s2 ==
"enumeration")
180 else if (s2 ==
"opaque")
191 d_is_global_attribute = at.d_is_global_attribute;
198 Attr_citer i = at.attr_map.begin();
199 Attr_citer ie = at.attr_map.end();
200 for (; i != ie; ++i) {
203 attr_map.push_back(e);
207 if (e->type == Attr_container) {
208 assert(e->attributes);
209 e->attributes->d_parent =
this;
217AttrTable::AttrTable() :
218 DapObj(), d_name(
""), d_parent(0), attr_map(), d_is_global_attribute(true)
222AttrTable::AttrTable(
const AttrTable &rhs) :
229void AttrTable::delete_attr_table()
231 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) {
237AttrTable::~AttrTable()
243AttrTable::operator=(
const AttrTable &rhs)
261 return attr_map.size();
286static void add_bad_attribute(
AttrTable *attr,
const string &type,
const string &name,
const string &value,
297 if (attr->
get_name().find(
"_dods_errors") != string::npos) {
302 string error_cont_name = attr->
get_name() +
"_dods_errors";
309#ifndef ATTR_STRING_QUOTE_FIX
310 error_cont->append_attr(name +
"_dap_explanation",
"String",
"\"" + msg +
"\"");
312 error_cont->append_attr(name +
"_dap_explanation",
"String", msg);
337 DBG(cerr <<
"Entering AttrTable::append_attr" << endl);
339 string lname =
www2id(name);
348 if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type)))
349 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is of a different type"));
350 if (iter != attr_map.end() && (
get_type(iter) ==
"Container"))
351 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is a container."));
353 if (iter != attr_map.end()) {
354 (*iter)->attr->push_back(value);
355 return (*iter)->attr->size();
362 e->type = String_to_AttrType(type);
363 e->attr =
new vector<string> ;
364 e->attr->push_back(value);
366 attr_map.push_back(e);
368 return e->attr->size();
392 DBG(cerr <<
"Entering AttrTable::append_attr(..., vector)" << endl);
394 string lname =
www2id(name);
402 if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type)))
403 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is of a different type"));
404 if (iter != attr_map.end() && (
get_type(iter) ==
"Container"))
405 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is a container."));
407 if (iter != attr_map.end()) {
408 vector<string>::iterator i = values->begin();
409 while (i != values->end())
410 (*iter)->attr->push_back(*i++);
412 return (*iter)->attr->size();
419 e->type = String_to_AttrType(type);
420 e->attr =
new vector<string> (*values);
422 attr_map.push_back(e);
424 return e->attr->size();
448 DBG(cerr <<
"Entering AttrTable::append_attr" << endl);
450 string lname =
www2id(name);
459 if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type)))
460 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is of a different type"));
461 if (iter != attr_map.end() && (
get_type(iter) ==
"Container"))
462 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is a container."));
464 if (iter != attr_map.end()) {
465 (*iter)->attr->push_back(value);
466 (*iter)->is_utf8_str = is_utf8_str;
467 return (*iter)->attr->size();
474 e->type = String_to_AttrType(type);
475 e->is_utf8_str = is_utf8_str;
476 e->attr =
new vector<string> ;
477 e->attr->push_back(value);
479 attr_map.push_back(e);
481 return e->attr->size();
506 DBG(cerr <<
"Entering AttrTable::append_attr(..., vector)" << endl);
508 string lname =
www2id(name);
516 if (iter != attr_map.end() && ((*iter)->type != String_to_AttrType(type)))
517 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is of a different type"));
518 if (iter != attr_map.end() && (
get_type(iter) ==
"Container"))
519 throw Error(
string(
"An attribute called `") + name +
string(
"' already exists but is a container."));
521 if (iter != attr_map.end()) {
522 vector<string>::iterator i = values->begin();
523 while (i != values->end())
524 (*iter)->attr->push_back(*i++);
525 (*iter)->is_utf8_str = is_utf8_str;
526 return (*iter)->attr->size();
533 e->type = String_to_AttrType(type);
534 e->is_utf8_str = is_utf8_str;
535 e->attr =
new vector<string> (*values);
537 attr_map.push_back(e);
539 return e->attr->size();
587 string lname =
www2id(name);
593 throw Error(
"There already exists a container called '" + name +
"' in this attribute table (" + at->
get_name() +
"). (1)");
595 DBG(cerr <<
"Setting appended attribute container name to: " << lname << endl);
601 e->type = Attr_container;
604 attr_map.push_back(e);
608 return e->attributes;
627 string::size_type dotpos = target.rfind(
'.');
628 if (dotpos != string::npos) {
629 string container = target.substr(0, dotpos);
630 string field = target.substr(dotpos + 1);
634 *iter = (*at)->simple_find(field);
637 *iter = attr_map.end();
661 if (target == (*i)->name) {
665 else if ((*i)->type == Attr_container) {
688 for (i = attr_map.begin(); i != attr_map.end(); ++i) {
689 if (target == (*i)->name) {
712 string::size_type dotpos = target.find(
'.');
713 if (dotpos != string::npos) {
714 string container = target.substr(0, dotpos);
715 string field = target.substr(dotpos + 1);
717 AttrTable *at = simple_find_container(container);
721 return simple_find_container(target);
727AttrTable::simple_find_container(
const string &target)
732 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) {
734 return (*i)->attributes;
760 return (p != attr_map.end()) ?
get_type(p) : (string)
"";
768 return (p != attr_map.end()) ?
get_attr_type(p) : Attr_unknown;
781 return (iter != attr_map.end()) ?
get_attr_num(iter) : 0;
822 string lname =
www2id(name);
828 if (iter != attr_map.end()) {
831 attr_map.erase(iter);
838 if ((*iter)->type == Attr_container)
841 vector<string> *sxp = (*iter)->attr;
843 assert(i >= 0 && i < (
int) sxp->size());
844 sxp->erase(sxp->begin() + i);
857 return attr_map.begin();
865 return attr_map.end();
878 return attr_map.begin() + i;
884 assert(iter != attr_map.end());
886 return (*iter)->name;
892 return (*i)->type == Attr_container;
903 assert(iter != attr_map.end());
904 return (*iter)->type == Attr_container ? (*iter)->attributes : 0;
927 if ((*iter)->type != Attr_container)
933 struct entry *e = *iter;
936 e->attributes->d_parent = 0;
938#if NEW_DEL_ATTR_TABLE_BEHAVIOR
939 delete e->attributes;
946 return attr_map.erase(iter);
954 assert(iter != attr_map.end());
963 return (*iter)->type;
975 assert(iter != attr_map.end());
976 return ((*iter)->type == Attr_container) ? (*iter)->attributes->get_size() : (*iter)->attr->size();
995string AttrTable::get_attr(Attr_iter iter,
unsigned int i)
997 assert(iter != attr_map.end());
999 return (*iter)->type == Attr_container ? (
string)
"None" : (*(*iter)->attr)[i];
1002string AttrTable::get_attr(
const string &name,
unsigned int i)
1005 return (p != attr_map.end()) ? get_attr(p, i) : (string)
"";
1022 assert(iter != attr_map.end());
1023 return (*iter)->type != Attr_container ? (*iter)->attr : 0;
1026bool AttrTable::is_global_attribute(Attr_iter iter)
1028 assert(iter != attr_map.end());
1029 if ((*iter)->type == Attr_container)
1030 return (*iter)->attributes->is_global_attribute();
1032 return (*iter)->is_global;
1035void AttrTable::set_is_global_attribute(Attr_iter iter,
bool ga)
1037 assert(iter != attr_map.end());
1038 if ((*iter)->type == Attr_container)
1039 (*iter)->attributes->set_is_global_attribute(ga);
1041 (*iter)->is_global = ga;
1055 string lname =
www2id(name);
1061 throw Error(
string(
"There already exists a container called `") + name +
string(
"in this attribute table. (2)"));
1067 e->type = Attr_container;
1069 e->attributes = src;
1071 attr_map.push_back(e);
1089 string lname =
www2id(name);
1095 string lsource =
www2id(source);
1105 das->
find(lsource, &at, &iter);
1111 if (!at || (iter == at->
attr_end()) || !*iter) {
1112 find(lsource, &at, &iter);
1113 if (!at || (iter == at->
attr_end()) || !*iter)
1114 throw Error(
string(
"Could not find the attribute `") + source +
string(
"' in the attribute object."));
1122 "A value cannot be aliased to the top level of the DAS;\nOnly containers may be present at that level of the DAS."));
1125 throw Error(
string(
"There already exists a container called `") + name +
string(
"in this attribute table. (3)"));
1130 e->aliased_to = lsource;
1132 if (at && e->type == Attr_container)
1135 e->attr = (*iter)->attr;
1137 attr_map.push_back(e);
1186 bool has_d4_attr =
false;
1187 for(
auto attr:attr_map){
1188 string attr_fqn = path +
"@" + attr->name;
1189 bool isa_d4_attr = attr->is_dap4_type(attr_fqn, inventory);
1193 has_d4_attr |= isa_d4_attr;
1204 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) {
1209 attr_map.erase(attr_map.begin(), attr_map.end());
1214const string double_quote =
"\"";
1227static void write_string_attribute_for_das(ostream &out,
const string &value,
const string &term,
bool is_utf8_str)
1230 string esc_value = is_utf8_str?value:
escattr(value);
1232 string esc_value =
escattr(value);
1238 out << esc_value << term;
1241 out << double_quote << esc_value << double_quote << term;
1246write_string_attribute_for_das(FILE *out,
const string &value,
const string &term)
1249 fprintf(out,
"%s%s", value.c_str(), term.c_str());
1251 fprintf(out,
"\"%s\"%s", value.c_str(), term.c_str());
1257static void write_xml_attribute_for_das(ostream &out,
const string &value,
const string &term)
1267write_xml_attribute_for_das(FILE *out,
const string &value,
const string &term)
1282 fwrite(oss.str().data(), 1, oss.str().length(), out);
1285 switch ((*i)->type) {
1286 case Attr_container:
1288 fprintf(out,
"%s%s {\n", pad.c_str(),
id2www(
get_name(i)).c_str());
1290 fprintf(out,
"%s%s {\n", pad.c_str(),
get_name(i).c_str());
1292 (*i)->attributes->print(out, pad +
" ", dereference);
1294 fprintf(out,
"%s}\n", pad.c_str());
1301 fprintf(out,
"%s%s %s ", pad.c_str(),
get_type(i).c_str(),
get_name(i).c_str());
1303 vector<string> *sxp = (*i)->attr;
1304 vector<string>::iterator last = sxp->end() - 1;
1305 for (vector<string>::iterator i = sxp->begin(); i != last; ++i) {
1306 write_string_attribute_for_das(out, *i,
", ");
1308 write_string_attribute_for_das(out, *last,
";\n");
1312 case Attr_other_xml: {
1316 fprintf(out,
"%s%s %s ", pad.c_str(),
get_type(i).c_str(),
get_name(i).c_str());
1318 vector<string> *sxp = (*i)->attr;
1319 vector<string>::iterator last = sxp->end() - 1;
1320 for (vector<string>::iterator i = sxp->begin(); i != last; ++i) {
1321 write_xml_attribute_for_das(out, *i,
", ");
1323 write_xml_attribute_for_das(out, *last,
";\n");
1331 fprintf(out,
"%s%s %s ", pad.c_str(),
get_type(i).c_str(),
get_name(i).c_str());
1334 vector<string> *sxp = (*i)->attr;
1335 vector<string>::iterator last = sxp->end() - 1;
1336 for (vector<string>::iterator i = sxp->begin(); i != last; ++i) {
1337 fprintf(out,
"%s%s", (*i).c_str(),
", ");
1339 fprintf(out,
"%s%s", (*last).c_str(),
";\n");
1350 switch ((*i)->type) {
1351 case Attr_container:
1357 (*i)->attributes->print(out, pad +
" ", dereference);
1358 out << pad <<
"}\n";
1367 vector<string> *sxp = (*i)->attr;
1369 vector<string>::iterator last = sxp->end() - 1;
1370 for (vector<string>::iterator i_s = sxp->begin(); i_s != last; ++i_s) {
1371 write_string_attribute_for_das(out, *i_s,
", ",(*i)->is_utf8_str);
1373 write_string_attribute_for_das(out, *last,
";\n",(*i)->is_utf8_str);
1380 for (
const auto &attr:(*sxp)) {
1381 if (attr != (*sxp).back())
1382 write_string_attribute_for_das(out, attr,
", ",(*i)->is_utf8_str);
1384 write_string_attribute_for_das(out, attr,
";\n",(*i)->is_utf8_str);
1390 case Attr_other_xml: {
1396 vector<string> *sxp = (*i)->attr;
1397 vector<string>::iterator last = sxp->end() - 1;
1398 for (vector<string>::iterator i = sxp->begin(); i != last; ++i) {
1399 write_xml_attribute_for_das(out, *i,
", ");
1401 write_xml_attribute_for_das(out, *last,
";\n");
1411 vector<string> *sxp = (*i)->attr;
1412 vector<string>::iterator last = sxp->end() - 1;
1413 for (vector<string>::iterator i = sxp->begin(); i != last; ++i) {
1416 out << *last <<
";\n";
1435 print(oss, pad, dereference);
1436 fwrite(oss.str().data(), 1, oss.str().length(), out);
1439 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) {
1440 if ((*i)->is_alias) {
1446 fprintf(out,
"%sAlias %s %s;\n",
1449 id2www((*i)->aliased_to).c_str());
1451 fprintf(out,
"%sAlias %s %s;\n",
1476 for (Attr_iter i = attr_map.begin(); i != attr_map.end(); ++i) {
1477 if ((*i)->is_alias) {
1484 <<
" " <<
id2www((*i)->aliased_to) <<
";\n";
1506 fwrite(xml.get_doc(),
sizeof(
char), xml.get_doc_size(), out);
1511 fwrite(oss.str().data(), 1, oss.str().length(), out);
1524 if ((*i)->is_alias) {
1525 fprintf(out,
"%s<Alias name=\"%s\" Attribute=\"%s\"/>\n",
1527 (*i)->aliased_to.c_str());
1531 fprintf(out,
"%s<Attribute name=\"%s\" type=\"%s\">\n",
1537 fprintf(out,
"%s</Attribute>\n", pad.c_str());
1540 fprintf(out,
"%s<Attribute name=\"%s\" type=\"%s\">\n",
1543 string value_pad = pad +
" ";
1549 throw Error(
"OtherXML attributes cannot be vector-valued.");
1550 fprintf(out,
"%s%s\n", value_pad.c_str(), get_attr(i, 0).c_str());
1554 fprintf(out,
"%s<value>%s</value>\n", value_pad.c_str(),
1555 id2xml(get_attr(i, j)).c_str());
1558 fprintf(out,
"%s</Attribute>\n", pad.c_str());
1571 out << xml.get_doc();
1575 if ((*i)->is_alias) {
1577 <<
"\" Attribute=\"" << (*i)->aliased_to <<
"\"/>\n";
1582 <<
"\" type=\"" <<
get_type(i) <<
"\">\n";
1586 out << pad <<
"</Attribute>\n";
1590 <<
"\" type=\"" <<
get_type(i) <<
"\">\n";
1592 string value_pad = pad +
" ";
1595 throw Error(
"OtherXML attributes cannot be vector-valued.");
1596 out << value_pad << get_attr(i, 0) <<
"\n";
1599 string value_pad = pad +
" ";
1601 out << value_pad <<
"<value>" <<
id2xml(get_attr(i, j)) <<
"</value>\n";
1604 out << pad <<
"</Attribute>\n";
1617 if ((*i)->is_alias) {
1618 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Alias") < 0)
1619 throw InternalErr(__FILE__, __LINE__,
"Could not write Alias element");
1620 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name",
1621 (
const xmlChar*)
get_name(i).c_str()) < 0)
1622 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1623 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"Attribute",
1624 (
const xmlChar*) (*i)->aliased_to.c_str()) < 0)
1625 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1626 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1627 throw InternalErr(__FILE__, __LINE__,
"Could not end Alias element");
1630 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Attribute") < 0)
1631 throw InternalErr(__FILE__, __LINE__,
"Could not write Attribute element");
1632 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name",
1633 (
const xmlChar*)
get_name(i).c_str()) < 0)
1634 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1635 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"type",
1636 (
const xmlChar*)
get_type(i).c_str()) < 0)
1637 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1641 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1642 throw InternalErr(__FILE__, __LINE__,
"Could not end Attribute element");
1645 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"Attribute") < 0)
1646 throw InternalErr(__FILE__, __LINE__,
"Could not write Attribute element");
1647 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"name",
1648 (
const xmlChar*)
get_name(i).c_str()) < 0)
1649 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1650 if (xmlTextWriterWriteAttribute(xml.get_writer(), (
const xmlChar*)
"type",
1651 (
const xmlChar*)
get_type(i).c_str()) < 0)
1652 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute for name");
1656 throw Error(
"OtherXML attributes cannot be vector-valued.");
1660 if (xmlTextWriterWriteRaw(xml.get_writer(), (
const xmlChar*) get_attr(i, 0).c_str()) < 0)
1661 throw InternalErr(__FILE__, __LINE__,
"Could not write OtherXML value");
1668 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"value") < 0)
1669 throw InternalErr(__FILE__, __LINE__,
"Could not write value element");
1671 string s = ((*i)->is_utf8_str)?get_attr(i,j):
escattr_xml(get_attr(i,j));
1672 if (xmlTextWriterWriteString(xml.get_writer(), (
const xmlChar*) s.c_str()) < 0)
1673 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute value");
1675 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1676 throw InternalErr(__FILE__, __LINE__,
"Could not end value element");
1681 if (xmlTextWriterStartElement(xml.get_writer(), (
const xmlChar*)
"value") < 0)
1682 throw InternalErr(__FILE__, __LINE__,
"Could not write value element");
1684 if (xmlTextWriterWriteString(xml.get_writer(), (
const xmlChar*) get_attr(i, j).c_str()) < 0)
1685 throw InternalErr(__FILE__, __LINE__,
"Could not write attribute value");
1687 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1688 throw InternalErr(__FILE__, __LINE__,
"Could not end value element");
1691 if (xmlTextWriterEndElement(xml.get_writer()) < 0)
1692 throw InternalErr(__FILE__, __LINE__,
"Could not end Attribute element");
1717 strm << DapIndent::LMarg <<
"AttrTable::dump - (" << (
void *)
this <<
")" << endl;
1718 DapIndent::Indent();
1719 strm << DapIndent::LMarg <<
"table name: " << d_name << endl;
1720 if (attr_map.size()) {
1721 strm << DapIndent::LMarg <<
"attributes: " << endl;
1722 DapIndent::Indent();
1723 Attr_citer i = attr_map.begin();
1724 Attr_citer ie = attr_map.end();
1725 for (; i != ie; ++i) {
1729 strm << DapIndent::LMarg <<
"alias: " << e->name <<
" aliased to: " << e->aliased_to << endl;
1731 else if (e->type == Attr_container) {
1732 strm << DapIndent::LMarg <<
"attr: " << e->name <<
" of type " << type << endl;
1733 DapIndent::Indent();
1734 e->attributes->
dump(strm);
1735 DapIndent::UnIndent();
1738 strm << DapIndent::LMarg <<
"attr: " << e->name <<
" of type " << type << endl;
1739 DapIndent::Indent();
1740 strm << DapIndent::LMarg;
1741 vector<string>::const_iterator iter = e->attr->begin();
1742 vector<string>::const_iterator last = e->attr->end() - 1;
1743 for (; iter != last; ++iter) {
1744 strm << (*iter) <<
", ";
1746 strm << (*(e->attr->end() - 1)) << endl;
1747 DapIndent::UnIndent();
1750 DapIndent::UnIndent();
1753 strm << DapIndent::LMarg <<
"attributes: empty" << endl;
1756 strm << DapIndent::LMarg <<
"parent table:" << d_name <<
":" << (
void *) d_parent << endl;
1759 strm << DapIndent::LMarg <<
"parent table: none" << d_name << endl;
1761 DapIndent::UnIndent();
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 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
A class for error processing.
A class for software fault reporting.
top level DAP object to house generic methods
string escattr_xml(string s)
string www2id(const string &in, const string &escape, const string &except)
string id2xml(string in, const string ¬_allowed)
string add_space_encoding(const string &s)
string AttrType_to_String(const AttrType at)
string escape_double_quotes(string source)
string remove_space_encoding(const string &s)
bool is_quoted(const string &s)
string id2www(string in, const string &allowable)