54inline bool double_eq(
double lhs,
double rhs,
double epsilon = 1.0e-5) {
return fabs(lhs - rhs) < epsilon; }
65bool unique_names(vector<BaseType *> l,
const string &var,
const string &type,
string &msg);
72void flush_stream(iostream ios, FILE *out);
144int glob(
const char *c,
const char *s);
145time_t
parse_time(
const char *str,
bool expand);
146bool size_ok(
unsigned int sz,
unsigned int nelem);
147bool pathname_ok(
const string &path,
bool strict =
true);
149string open_temp_fstream(ofstream &f,
const string &name_template,
const string &suffix =
"");
A multidimensional array of identical data types.
top level DAP object to house generic methods
string open_temp_fstream(ofstream &f, const string &name_template, const string &suffix)
const char * libdap_name()
string long_to_string(long val, int base)
bool size_ok(unsigned int sz, unsigned int nelem)
sanitize the size of an array. Test for integer overflow when dynamically allocating an array.
string remove_quotes(const string &s)
void append_double_to_string(const double &num, string &str)
string path_to_filename(string path)
bool is_host_big_endian()
Does this host use big-endian byte order?
const char * libdap_version()
double extract_double_value(BaseType *arg)
string prune_spaces(const string &name)
void append_long_to_string(long val, int base, string &str_val)
void set_array_using_double(Array *dest, double *src, int src_len)
bool is_simple_type(Type t)
Returns true if the instance is a numeric, string or URL type variable.
bool dir_exists(const string &dir)
bool pathname_ok(const string &path, bool strict)
Does the string name a potentially valid pathname? Test the given pathname to verify that it is a val...
string double_to_string(const double &num)
bool double_eq(double lhs, double rhs, double epsilon=1.0e-5)
string D2type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only typ...
const char * libdap_root()
string D4type_name(Type t)
Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only typ...
bool is_constructor_type(Type t)
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
bool is_vector_type(Type t)
Returns true if the instance is a vector (i.e., array) type variable.
bool is_integer_type(Type t)
time_t parse_time(const char *str, bool expand)
int glob(const char *c, const char *s)
string extract_string_argument(BaseType *arg)
ObjectType get_type(const string &value)
double * extract_double_array(Array *a)
bool is_quoted(const string &s)
bool unique_names(vector< BaseType * > l, const string &var_name, const string &type_name, string &msg)