50 _str =
dynamic_cast<Str *
>(b) ;
53 string s = (string)
"File out netcdf, FONcStr was passed a "
54 +
"variable that is not a DAP Str" ;
68 if( _data )
delete _data ;
84 BESDEBUG(
"fonc",
"FONcStr::define - defining "
93 _str->buf2val( (
void**)&_data ) ;
94 int size = _data->size() + 1 ;
97 int stax = nc_def_dim( ncid, dimname.c_str(), size, &_dimid ) ;
98 if( stax != NC_NOERR )
100 string err = (string)
"fileout.netcdf - "
101 +
"Failed to define dim " + dimname +
" for "
106 var_dims[0] = _dimid ;
107 stax = nc_def_var( ncid,
_varname.c_str(), NC_CHAR, 1,
109 if( stax != NC_NOERR )
111 string err = (string)
"fileout.netcdf - "
112 +
"Failed to define var " +
_varname ;
118 FONcAttributes::add_attributes( ncid,
_varid, _str ) ;
122 BESDEBUG(
"fonc",
"FONcStr::define - done defining "
141 size_t var_start[1] ;
142 size_t var_count[1] ;
144 var_count[0] = _data->size() + 1 ;
146 int stax = nc_put_vara_text( ncid,
_varid, var_start, var_count,
148 if( stax != NC_NOERR )
150 string err = (string)
"fileout.netcdf - "
151 +
"Failed to write string data " + *_data +
" for "
169 return _str->name() ;
192 << (
void *)
this <<
")" << endl ;
exception thrown if inernal error encountered
FONcStr(BaseType *b)
Constructor for FONcStr that takes a DAP Str.
virtual string name()
returns the name of the DAP Str
virtual ~FONcStr()
Destructor that cleans up the str.
static void add_original_name(int ncid, int varid, const string &var_name, const string &orig)
Adds an attribute for the variable if the variable name had to be modified in any way...
static ostream & LMarg(ostream &strm)
static void handle_error(int stax, string &err, const string &file, int line)
handle any netcdf errors
A DAP BaseType with file out netcdf information included.
virtual void define(int ncid)
Define the string variable in the netcdf file.
virtual void write(int ncid)
Write the str out to the netcdf file.
static string gen_name(const vector< string > &embed, const string &name, string &original)
generate a new name for the embedded variable
virtual nc_type type()
returns the netcdf type of the DAP Str
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes