38static char rcsid[] not_used = {
"$Id$"};
43#include <libdap/DAS.h>
44#include <libdap/InternalErr.h>
46#include "WWWStructure.h"
47#include "WWWSequence.h"
49#include "get_html_form.h"
51using namespace dap_html_form;
54WWWStructure::ptr_duplicate()
56 return new WWWStructure(*
this);
59WWWStructure::WWWStructure(
const string &n) :
64WWWStructure::WWWStructure(Structure *bt) :
67 Vars_iter p = bt->var_begin();
68 while (p != bt->var_end()) {
69 BaseType *new_bt = basetype_to_wwwtype(*p);
70 new_bt->set_attr_table((*p)->get_attr_table());
77WWWStructure::~WWWStructure()
88WWWStructure::print_val(FILE *os,
string ,
bool print_decls)
90 fprintf(os,
"<b>Structure %s </b><br>\n", name().c_str());
91 fprintf(os,
"<dl><dd>\n");
93 for (Vars_iter i = var_begin(); i != var_end(); ++i) {
94 (*i)->print_val(os,
"", print_decls);
95 wo->write_variable_attributes(*i);
96 fprintf(os,
"<p><p>\n");
99 fprintf(os,
"</dd></dl>\n");
104WWWStructure::print_val(
ostream &strm,
string ,
bool print_decls)
106 strm <<
"<b>Structure " << name() <<
" </b><br>\n";
107 strm <<
"<dl><dd>\n";
109 for (Vars_iter i = var_begin(); i != var_end(); ++i) {
110 (*i)->print_val(strm,
"", print_decls);
111 wo->write_variable_attributes(*i);
115 strm <<
"</dd></dl>\n";
121bool WWWStructure::is_simple_structure()
123 for (Vars_iter i = var_begin(); i != var_end(); ++i) {
124 if ((*i)->type() == dods_structure_c) {
125 if (!
dynamic_cast<WWWStructure *
> (*i)->is_simple_structure())
129 if (!(*i)->is_simple_type())