|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
#include "config_ff.h"#include <unistd.h>#include <iostream>#include <sstream>#include <fstream>#include <string>#include <vector>#include <cstdlib>#include <BESDebug.h>#include <BaseType.h>#include <Byte.h>#include <Int16.h>#include <Int32.h>#include <UInt16.h>#include <UInt32.h>#include <Float32.h>#include <Float64.h>#include <InternalErr.h>#include <dods-limits.h>#include <util.h>#include <debug.h>#include "FFRequestHandler.h"#include "util_ff.h"
Go to the source code of this file.
Functions | |
| int | ff_prec (Type dods_type) |
| const string | ff_types (Type dods_type) |
| bool | file_exist (const char *filename) |
| const string | find_ancillary_rss_das (const string &dataset, const string &, const string &) |
| Find the RSS (Remote Sensing Systems) format file using their naming convention. More... | |
| const string | find_ancillary_rss_formats (const string &dataset, const string &, const string &) |
| Find the RSS (Remote Sensing Systems) format file using their naming convention. More... | |
| const string & | format_delimiter (const string &new_delimiter) |
| Set or get the format file delimiter. More... | |
| const string & | format_extension (const string &new_extension) |
| Set or get the format file extension. More... | |
| void | free_ff_char_vector (char **v, int len) |
| Free a char ** vector that db_ask() allocates. More... | |
| dods_float64 | get_float_value (BaseType *var) throw (InternalErr) |
| dods_uint32 | get_integer_value (BaseType *var) throw (InternalErr) |
| Get the value of the BaseType Variable. More... | |
| BOOLEAN | is_a_warning (FF_ERROR_PTR error) |
| bool | is_float_type (BaseType *btp) |
| bool | is_integer_type (BaseType *btp) |
| const string | make_output_format (const string &name, Type type, const int width) |
| Make a FreeForm output format specification. More... | |
| const string | makeND_output_format (const string &name, Type type, const int width, int ndim, const long *start, const long *edge, const long *stride, string *dname) |
| FF_ERROR_PTR | pull_error (void) |
| 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. More... | |
| long | Records (const string &filename) |
| Figure out how many records there are in the dataset. More... | |
| 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 code. More... | |
| int ff_prec | ( | Type | dods_type | ) |
Definition at line 279 of file util_ff.cc.
Referenced by make_output_format(), makeND_output_format(), FFD4Sequence::read(), and FFSequence::read().
| const string ff_types | ( | Type | dods_type | ) |
Definition at line 247 of file util_ff.cc.
Referenced by make_output_format(), makeND_output_format(), FFD4Sequence::read(), and FFSequence::read().
| bool file_exist | ( | const char * | filename | ) |
Definition at line 532 of file util_ff.cc.
Referenced by ff_read_descriptors(), and read_attributes().
| const string find_ancillary_rss_das | ( | const string & | dataset, |
| const string & | , | ||
| const string & | |||
| ) |
Find the RSS (Remote Sensing Systems) format file using their naming convention.
File naming convention: <data source>=""> + '_' + <date_string> + <version> + (optional)< _d3d > When <date_string> includes YYYYMMDDVV ('DD') the file contains 'daily' data. When <date_string> only includes YYYYMMVV ( no 'DD'), or includes ('DD') and optional '_d3d' then the file contains averaged data.
Different format files are required for 'daily' and 'averaged' data.
Definition at line 607 of file util_ff.cc.
References FFRequestHandler::get_RSS_format_files().
Referenced by FFRequestHandler::ff_build_das().

| const string find_ancillary_rss_formats | ( | const string & | dataset, |
| const string & | , | ||
| const string & | |||
| ) |
Find the RSS (Remote Sensing Systems) format file using their naming convention.
File naming convention: <data source>=""> + '_' + <date_string> + <version> + (optional)< _d3d > When <date_string> includes YYYYMMDDVV ('DD') the file contains 'daily' data. When <date_string> only includes YYYYMMVV ( no 'DD'), or includes ('DD') and optional '_d3d' then the file contains averaged data.
Different format files are required for 'daily' and 'averaged' data.
Definition at line 550 of file util_ff.cc.
References FFRequestHandler::get_RSS_format_files().
Referenced by ff_read_descriptors(), and read_attributes().

| const string& format_delimiter | ( | const string & | new_delimiter | ) |
Set or get the format file delimiter.
If given no argument, return the format file basename delimiter. If given a string argument, set the format file basename delimiter to that string.
Definition at line 344 of file util_ff.cc.
| const string& format_extension | ( | const string & | new_extension | ) |
Set or get the format file extension.
If given no argument, return the format file extension. If given a string argument, set the format file extension to that string.
Definition at line 360 of file util_ff.cc.
| void free_ff_char_vector | ( | char ** | v, |
| int | len | ||
| ) |
Free a char ** vector that db_ask() allocates.
This code uses free() to do the delete.
Definition at line 232 of file util_ff.cc.
References free().

| dods_float64 get_float_value | ( | BaseType * | var | ) | |
| throw | ( | InternalErr | |||
| ) | |||||
Definition at line 735 of file util_ff.cc.
References get_integer_value().
Referenced by DODS_Time_Factory::get().

| dods_uint32 get_integer_value | ( | BaseType * | var | ) | |
| throw | ( | InternalErr | |||
| ) | |||||
Get the value of the BaseType Variable.
If it's not something that we can convert to an integer, throw InternalErr.
| var | The variable |
Definition at line 708 of file util_ff.cc.
Referenced by DODS_Time_Factory::get(), DODS_Date_Factory::get(), and get_float_value().
| BOOLEAN is_a_warning | ( | FF_ERROR_PTR | error | ) |
| bool is_float_type | ( | BaseType * | btp | ) |
Definition at line 678 of file util_ff.cc.
Referenced by DODS_Time_Factory::DODS_Time_Factory().
| bool is_integer_type | ( | BaseType * | btp | ) |
Definition at line 652 of file util_ff.cc.
Referenced by DODS_Date_Factory::DODS_Date_Factory(), and DODS_Time_Factory::DODS_Time_Factory().
| const string make_output_format | ( | const string & | name, |
| Type | type, | ||
| const int | width | ||
| ) |
Make a FreeForm output format specification.
For the current instance of FFArray, build a FreeForm output format specification.
Definition at line 306 of file util_ff.cc.
References ff_prec(), and ff_types().

| const string makeND_output_format | ( | const string & | name, |
| Type | type, | ||
| const int | width, | ||
| int | ndim, | ||
| const long * | start, | ||
| const long * | edge, | ||
| const long * | stride, | ||
| string * | dname | ||
| ) |
Definition at line 319 of file util_ff.cc.
References ff_prec(), and ff_types().
Referenced by FFArray::read().

| FF_ERROR_PTR pull_error | ( | void | ) |
| 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.
Data values are read using an input file descriptor and written using an output format description.
| dataset | The name of the file/database to read from |
| if_file | The input format descriptor |
| o_format | The output format description |
| o_buffer | Value-result parameter for the data |
| bsize | Size of the buffer in bytes |
Definition at line 156 of file util_ff.cc.
References BES_SYNTAX_USER_ERROR, BESDEBUG, struct_ff_bufsize::buffer, struct_ff_bufsize::bytes_used, err_count(), struct_ff_std_args::error_prompt, FALSE, ff_create_bufsize(), ff_create_std_args(), ff_destroy_bufsize(), ff_destroy_std_args(), struct_ff_std_args::input_file, struct_ff_std_args::input_format_file, struct_ff_std_args::struct_std_args_user::is_stdin_redirected, struct_ff_std_args::log_file, newform(), NULL, struct_ff_std_args::output_bufsize, struct_ff_std_args::output_file, struct_ff_std_args::output_format_buffer, SCRATCH_QUANTA, struct_ff_bufsize::total_bytes, struct_ff_bufsize::usage, and struct_ff_std_args::user.
Referenced by FFArray::extract_array(), FFD4Sequence::read(), and FFSequence::read().

| long Records | ( | const string & | filename | ) |
Figure out how many records there are in the dataset.
| filename |
set the structure values to create the FreeForm DB
Definition at line 487 of file util_ff.cc.
References db_ask(), db_destroy(), DBASK_PROCESS_INFO, dll_first(), ERR_WARNING_ONLY, ff_create_std_args(), ff_destroy_process_info_list(), ff_destroy_std_args(), FFF_DATA, FFF_INPUT, struct_ff_std_args::input_file, struct_ff_std_args::struct_std_args_user::is_stdin_redirected, NULL, struct_ff_std_args::output_file, PINFO_SUPER_ARRAY_ELS, SetDodsDB(), and struct_ff_std_args::user.
Referenced by FFD4Sequence::read(), and FFSequence::read().

| 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 code.
Once called, the caller should free the std_args parameter.
| std_args | A pointer to a structure that holds a number of input and out file names. |
Definition at line 402 of file util_ff.cc.
References assert, db_make(), db_set(), DBSET_CREATE_CONDUITS, DBSET_HEADER_FILE_NAMES, DBSET_HEADERS, DBSET_INIT_CONDUITS, DBSET_INPUT_FORMATS, DBSET_READ_EQV, dll_free_holdings(), ERR_API, ERR_MEM_LACK, FFF_DATA, FFF_INPUT, struct_ff_std_args::input_file, struct_ff_std_args::input_format_buffer, struct_ff_std_args::input_format_file, struct_ff_std_args::input_format_title, Msgt_size, NULL, struct_ff_std_args::output_file, struct_ff_std_args::records_to_read, and ROUTINE_NAME.
Referenced by ff_read_descriptors(), read_attributes(), and Records().
