30 using std::ostringstream;
46 static long Records(
const string &filename)
53 static char Msgt[255];
62 SetUps->
input_file =
const_cast<char*
>(filename.c_str());
102 DBG(cerr <<
"Entering FFD4Sequence::read..." << endl);
116 o_fmt <<
"binary_output_data \"DODS binary output data\"" << endl;
117 for (Vars_iter p = var_begin(); p != var_end(); ++p) {
118 if ((*p)->synthesized_p())
120 if ((*p)->type() == dods_str_c)
121 endbyte += static_cast<FFStr&>(**p).length();
123 endbyte += (*p)->width();
125 o_fmt << (*p)->name() <<
" " << stbyte <<
" " << endbyte <<
" " <<
ff_types((*p)->type()) <<
" "
126 <<
ff_prec((*p)->type()) << endl;
127 stbyte = endbyte + 1;
130 DBG(cerr << o_fmt.str());
133 long num_rec =
Records(dataset());
138 BufSiz = num_rec * (stbyte - 1);
141 long bytes =
read_ff(dataset().c_str(), d_input_format_file.c_str(), o_fmt.str().c_str(),
BufVal,
BufSiz);
144 throw Error(
"Could not read requested data from the dataset.");
147 for (Vars_iter p = var_begin(); p != var_end(); ++p)
158 Vars_iter var = var_begin();
159 while (var != var_end()) {
160 (*var)->transfer_attributes(at);
long Records(const string &filename)
Figure out how many records there are in the dataset.
int SetDodsDB(FF_STD_ARGS_PTR std_args, DATA_BIN_HANDLE dbin_h, char *Msgt)
Given a set of standard arguments (input filenames), allocate a DATA-BIN_HANDLE and return an error c...
struct struct_ff_std_args::struct_std_args_user user
virtual bool read()
Read a row from the Sequence.
unsigned int is_stdin_redirected
const string ff_types(Type dods_type)
int ff_prec(Type dods_type)
virtual void transfer_attributes(AttrTable *at)
long read_ff(const char *dataset, const char *if_file, const char *o_format, char *o_buffer, unsigned long bsize)
Read from a file/database using the FreeForm API.