41 #include "InternalErr.h"
43 #include "AsciiStructure.h"
44 #include "AsciiSequence.h"
46 #include "get_ascii.h"
48 using namespace dap_asciival;
51 AsciiStructure::ptr_duplicate()
56 AsciiStructure::AsciiStructure(
const string &n) :
61 AsciiStructure::AsciiStructure(Structure *bt) :
67 Vars_iter p = bt->var_begin();
68 while (p != bt->var_end()) {
69 BaseType *new_bt = basetype_to_asciitype(*p);
77 BaseType::set_send_p(bt->send_p());
80 AsciiStructure::~AsciiStructure()
84 void AsciiStructure::transform_to_dap4(D4Group *root, Constructor *container){
85 cerr << __func__ <<
"() -BEGIN " <<
86 "('"<< root->name() <<
"':"<< (
void *)root <<
")" <<
87 "('"<< container->name() <<
"':"<< (
void *)container <<
")" <<
90 Constructor::transform_to_dap4(root,dest);
91 container->add_var_nocopy(dest);
92 cerr << __func__ <<
"() - END" << endl;
95 void AsciiStructure::print_header(ostream &strm)
97 Vars_iter p = var_begin();
98 while (p != var_end()) {
99 if ((*p)->is_simple_type())
100 strm << dynamic_cast<AsciiOutput&>(**p).get_full_name();
101 else if ((*p)->type() == dods_structure_c)
106 throw InternalErr(__FILE__, __LINE__,
107 "Support for ASCII output of datasets with structures which contain Sequences or Grids has not been completed.");
108 if (++p != var_end()) strm <<
", ";
114 BESDEBUG(
"ascii",
"In 'AsciiStructure::print_ascii'" << endl);
122 Vars_iter p = var_begin();
123 while (p != var_end()) {
126 if (++p != var_end()) strm <<
", ";
130 for (Vars_iter p = var_begin(); p != var_end(); ++p) {
131 if ((*p)->send_p()) {