libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap Namespace Reference

top level DAP object to house generic methods More...

Classes

class  AlarmHandler
class  Ancillary
class  Array
 A multidimensional array of identical data types. More...
class  AttrTable
 Contains the attributes for a dataset. More...
class  BaseTypeFactory
class  Byte
 Holds a single byte. More...
struct  ce_parser_arg
class  ChildLocker
class  chunked_inbuf
class  chunked_istream
class  chunked_ostream
 A C++ stream class for chunked data. This class uses the chunked_outbuf class to provide for chunked binary serialization of data as specified by DAP4. Information to be serialized is broken into 'chunks' that are no more than 2^24 bytes in length. Each chunk is prefixed by a 4 byte header that indicates the type of chunk and size (number of bytes in the chunk body). There are three types of chunk: Data; End; and Error. In normal operation, a DAP4 data document/response is serialized as a sequence of DATA chunks followed by one END chunk (which may be zero bytes in length). If, during serialization, an error is detected, the currently buffered (but not sent) data are discarded and an ERROR chunk is sent with an error message. More...
class  chunked_outbuf
 output buffer for a chunked stream This performs buffered output encoding the data in the stream using the simple chunking protocol defined for DAP4's binary data transmission. Each block of data is prefixed by four bytes: A CHUNK TYPE byte followed by three bytes that are the CHUNK SIZE. There are three CHUNK TYPES: data, end and error, indicated by the code values 0x00, 0x01 and 0x02. The size of a chunk is limited to 2^24 data bytes + 4 bytes for the chunk header. More...
struct  Clause
 Holds a fragment of a constraint expression. More...
class  Connect
 Holds information about the link from a DAP2 client to a dataset. More...
class  ConstraintEvaluator
 Evaluate a constraint expression. More...
class  Constructor
class  D4AsyncUtil
class  D4Attribute
class  D4Attributes
class  D4BaseTypeFactory
class  D4CEScanner
class  D4Connect
class  D4ConstraintEvaluator
class  D4Dimension
class  D4Dimensions
class  D4Enum
 Holds a DAP4 enumeration. More...
class  D4EnumDef
class  D4EnumDefs
class  D4FilterClause
 DAP4 filter clauses. More...
class  D4FilterClauseList
 List of DAP4 Filter Clauses. More...
class  D4FunctionEvaluator
class  D4FunctionScanner
class  D4Group
class  D4Map
class  D4Maps
class  D4Opaque
class  D4ParserSax2
class  D4RValue
class  D4RValueList
class  D4StreamMarshaller
 Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiver-makes-right scheme. This code adds checksums to the stream and uses the xdr library to encode real values if the underlying representation is not IEEE 754. It also supports computing the checksum only. More...
class  D4StreamUnMarshaller
 Read data from the stream made by D4StreamMarshaller. More...
class  DapIndent
 class with static methods to help with indentation of debug information. More...
class  DapObj
 libdap base object for common functionality of libdap objects More...
class  DapXmlNamspaces
class  DAS
 Hold attribute data for a DAP2 dataset. More...
class  DataDDS
 Holds a DAP2 DDS. More...
class  DDS
class  DDXParseFailed
class  DDXParser
class  DMR
class  Error
 A class for error processing. More...
class  EventHandler
class  Float32
 Holds a 32-bit floating point value. More...
class  Float64
 Holds a 64-bit (double precision) floating point value. More...
class  HTTPCacheInterruptHandler
class  HTTPCacheResponse
class  HTTPCacheTable
class  HTTPConnect
class  HTTPResponse
class  Int16
 Holds a 16-bit signed integer value. More...
class  Int32
 Holds a 32-bit signed integer. More...
class  Int64
 Holds a64-bit signed integer. More...
class  Int8
 Holds an 8-bit signed integer value. More...
class  InternalErr
 A class for software fault reporting. More...
class  Keywords
class  Locker
class  Marshaller
 abstract base class used to marshal/serialize dap data objects More...
class  MarshallerThread
struct  parser_arg
 Pass parameters by reference to a parser. More...
class  PipeResponse
 Encapsulate a response. This class provides special treatment for 'stream pipes.' It arranges to close them using pclose() instead of fclose(). More...
class  RCReader
class  Regex
 Regular expression matching. More...
class  Resource
 Associate a rule with an ancillary resource. More...
class  Response
class  ResponseTooBigErr
class  rvalue
class  ServerFunction
class  ServerFunctionsList
class  SignalHandler
class  SignalHandlerRegisteredErr
class  StdinResponse
 Encapsulate a response read from stdin. More...
class  Str
 Holds character string data. More...
class  Structure
 Holds a structure (aggregate) type. More...
class  UInt16
 Holds an unsigned 16-bit integer. More...
class  UInt32
 Holds a 32-bit unsigned integer. More...
class  UInt64
 Holds a 64-bit unsigned integer. More...
class  UnMarshaller
 abstract base class used to unmarshall/deserialize dap data objects More...
class  Url
 Holds an Internet address (URL). More...
class  XDRFileMarshaller
 marshaller that knows how to marshall/serialize dap data objects to a file using XDR More...
class  XDRFileUnMarshaller
 unmarshaller that knows how to unmarshall/deserialize dap objects using XDR from a file More...
class  XDRStreamMarshaller
 Marshaller that knows how serialize dap data objects to a C++ iostream using XDR. More...
class  XDRStreamUnMarshaller
 unmarshaller that knows how to unmarshall/deserialize dap objects using XDR from a file More...
class  XDRUtils
class  XMLWriter

Typedefs

typedef vector< BaseType * > BaseTypeRow
typedef std::vector< dods_byte > * byte_arg_list
typedef BaseType *(* D4Function) (D4RValueList *, DMR &)
typedef vector< BaseType * > D4SeqRow
typedef vector< D4SeqRow * > D4SeqValues
typedef uint8_t dods_byte
typedef int64_t dods_enum
typedef float dods_float32
typedef double dods_float64
typedef int16_t dods_int16
typedef int32_t dods_int32
typedef int64_t dods_int64
typedef int8_t dods_int8
typedef uint16_t dods_uint16
typedef uint32_t dods_uint32
typedef uint64_t dods_uint64
typedef int ErrorCode
 An enumerated type for common errors.
typedef std::vector< dods_float32 > * float32_arg_list
typedef std::vector< dods_float64 > * float64_arg_list
typedef std::vector< dods_int16 > * int16_arg_list
typedef std::vector< dods_int32 > * int32_arg_list
typedef std::vector< rvalue * > rvalue_list
typedef std::vector< rvalue * >::const_iterator rvalue_list_citer
typedef std::vector< rvalue * >::iterator rvalue_list_iter
typedef vector< BaseTypeRow * > SequenceValues
typedef void Sigfunc(int)
typedef std::vector< dods_uint16 > * uint16_arg_list
typedef std::vector< dods_uint32 > * uint32_arg_list

Enumerations

enum  AttrType {
  Attr_unknown , Attr_container , Attr_byte , Attr_int16 ,
  Attr_uint16 , Attr_int32 , Attr_uint32 , Attr_float32 ,
  Attr_float64 , Attr_string , Attr_url , Attr_other_xml ,
  Attr_int8 , Attr_uint8 , Attr_int64 , Attr_uint64 ,
  Attr_enum , Attr_opaque
}
enum  CacheDisconnectedMode { DISCONNECT_NONE = 0 , DISCONNECT_NORMAL = 1 , DISCONNECT_EXTERNAL = 2 }
enum  DAPVersion { DAP_2_0 , DAP_3_2 , DAP_4_0 }
enum  EncodingType {
  unknown_enc , deflate , x_plain , gzip ,
  binary
}
 The type of encoding used on the current stream. More...
enum  ObjectType {
  unknown_type , dods_das , dods_dds , dods_data ,
  dods_ddx , dods_data_ddx , dods_error , web_error ,
  dap4_dmr , dap4_data , dap4_error
}
 The type of object in the stream coming from the data server. More...
enum  Part { nil , array , maps }
 Names the parts of multi-section constructor data types. More...
enum  RejectReasonCode { TIME , UNAVAILABLE , PRIVILEGES , OTHER }
enum  Response {
  Unknown_Response , DAS_Response , DDS_Response , DataDDS_Response ,
  DDX_Response , DataDDX_Response , BLOB_Response , Version_Response
}
 Common functions for DODS server filter programs. More...
enum  Type {
  dods_null_c , dods_byte_c , dods_int16_c , dods_uint16_c ,
  dods_int32_c , dods_uint32_c , dods_float32_c , dods_float64_c ,
  dods_str_c , dods_url_c , dods_structure_c , dods_array_c ,
  dods_sequence_c , dods_grid_c , dods_char_c , dods_int8_c ,
  dods_uint8_c , dods_int64_c , dods_uint64_c , dods_enum_c ,
  dods_opaque_c , dods_group_c
}
 Identifies the data type. More...

Functions

string add_space_encoding (const string &s)
virtual void add_var (BaseType *bt, Part part=nil)
virtual void add_var_nocopy (BaseType *bt, Part part=nil)
void append_long_to_string (long val, int base, string &str_val)
rvalue_list * append_rvalue_list (rvalue_list *rvals, rvalue *rv)
virtual D4Attributesattributes ()
string AttrType_to_String (const AttrType at)
int64_t buf2val_ll (void **val)
BaseType ** build_btp_args (const rvalue_list *args, DDS &dds)
string char2ASCII (string s, const string escape="%[0-7][0-9a-fA-F]")
int check_byte (const char *val)
 Is the value a valid byte?
int check_float32 (const char *val)
int check_float64 (const char *val)
int check_float64 (const char *val, double &v)
int check_int16 (const char *val)
int check_int32 (const char *val)
int check_int32 (const char *val, int &v)
int check_int64 (const char *val)
virtual bool check_semantics (string &msg, bool all=false)
int check_uint16 (const char *val)
int check_uint32 (const char *val)
int check_uint32 (const char *val, unsigned int &v)
int check_uint64 (const char *val)
int check_url (const char *val)
 Is the value a valid URL?
D4FilterClauseListclauses ()
 Access the filter clauses for this D4Sequence.
virtual void clear_local_data ()
 The basic data type for the DODS DAP types. */.
void close_temp (FILE *s, const string &name)
template<class T1, class T2>
bool Cmp (int op, T1 v1, T2 v2)
string D2type_name (Type t)
 Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only types. Also returns Url (DAP2) and not "URL" (DAP4) for the URL type.
virtual bool d4_ops (BaseType *b, int op)
string D4AttributeTypeToString (D4AttributeType at)
D4RValueD4RValueFactory (std::string cpps)
 Build an appropriate RValue.
string D4type_name (Type t)
 Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only types. Also returns URL (DAP4) and not "Url" (DAP2) for the URL type.
virtual string dataset () const
 Returns the name of the dataset used to create this instance.
virtual void dataset_constraint (DDS &dds, ConstraintEvaluator &eval, FILE *out, bool ce_eval=true) const
virtual void dataset_constraint (DDS &dds, ConstraintEvaluator &eval, ostream &out, bool ce_eval=true) const
virtual void dataset_constraint_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &out, const string &boundary, const string &start, bool ce_eval=true) const
string date_time_str (time_t *calendar, bool local)
bool dir_exists (const string &dir)
 DODSFilter ()
 DODSFilter (int argc, char *argv[])
 DODSFilter constructor.
bool double_eq (double lhs, double rhs, double epsilon=1.0e-5)
void downcase (string &s)
void dump (ostream &strm) const override
virtual int element_count (bool leaves=false)
string esc2underscore (string s)
string escape_double_quotes (string source)
string escattr (string s)
string escattr_xml (string s)
virtual void establish_timeout (FILE *stream) const
virtual void establish_timeout (ostream &stream) const
double * extract_double_array (Array *a)
void extract_double_array (Array *a, vector< double > &dest)
double extract_double_value (BaseType *arg)
string extract_string_argument (BaseType *arg)
void fillConstructorAttrTable (AttrTable *at, BaseType *bt)
 Recursive helper function for Building DAS entries for Constructor types.
virtual std::string FQN () const
virtual void functional_constraint (BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const
virtual void functional_constraint (BaseType &var, DDS &dds, ConstraintEvaluator &eval, ostream &out) const
virtual string get_action () const
virtual BaseTypeget_ancestor ()
virtual AttrTableget_attr_table ()
char * get_buf ()
 Holds a one-dimensional collection of DAP2 data types.
virtual string get_cache_dir () const
 Get the cache directory.
virtual string get_ce () const
 Get the constraint expression.
virtual string get_cgi_version () const
vector< BaseType * > & get_compound_buf ()
AttrType get_dap2_AttrType (D4AttributeType d4_type)
virtual time_t get_das_last_modified_time (const string &anc_location="") const
virtual time_t get_data_last_modified_time (const string &anc_location="") const
virtual time_t get_dataset_last_modified_time () const
virtual string get_dataset_name () const
virtual string get_dataset_version () const
 Get the version information for the dataset.
virtual time_t get_dds_last_modified_time (const string &anc_location="") const
string get_dims_decl (Array &a)
double get_float64 (const char *val)
int get_hash (const string &url)
int get_int32 (const char *val)
long long get_int64 (const char *val)
virtual BaseTypeget_parent () const
virtual time_t get_request_if_modified_since () const
virtual Response get_response () const
vector< string > & get_str ()
string get_temp_file (FILE *&stream)
int get_timeout () const
Type get_type (const char *name)
unsigned int get_uint32 (const char *val)
unsigned long long get_uint64 (const char *val)
virtual string get_URL () const
 Get the dataset name.
virtual unsigned int get_value_capacity () const
virtual uint64_t get_value_capacity_ll () const
bool has_dap2_attributes (AttrTable &a)
bool has_dap2_attributes (BaseType *btp)
string hexstring (unsigned char val)
string id2www (string in, const string &allowable)
string id2www_ce (string in, const string &allowable)
string id2xml (string in, const string &not_allowed)
void initialize ()
void initialize (int argc, char *argv[])
virtual bool is_conditional () const
 Is this request conditional?
virtual bool is_constructor_type () const
 Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
bool is_constructor_type (Type t)
 Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.
virtual bool is_dap4 () const
bool is_host_big_endian ()
 Does this host use big-endian byte order?
virtual bool is_in_selection ()
 Is this variable part of the current selection?
bool is_integer_type (Type t)
bool is_keyword (string id, const string &keyword)
bool is_quoted (const string &s)
virtual bool is_simple_type () const
 Returns true if the instance is a numeric, string or URL type variable.
bool is_simple_type (Type t)
 Returns true if the instance is a numeric, string or URL type variable.
virtual bool is_vector_type () const
 Returns true if the instance is a vector (i.e., array) type variable.
bool is_vector_type (Type t)
 Returns true if the instance is a vector (i.e., array) type variable.
virtual int length () const
 How many elements are in this variable? Uses -1 in places.
virtual int64_t length_ll () const
 Get the number of elements in this variable This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that a Vector/Array holds no values yet (as opposed to zero values). For types not derived from Vector, there is always one element.
const char * libdap_name ()
const char * libdap_root ()
const char * libdap_version ()
string long_to_string (long val, int base)
rvalue_list * make_rvalue_list (rvalue *rv)
string munge_error_message (string msg)
virtual string name () const
string octal_to_hex (const string &octal_digits)
string octstring (unsigned char val)
virtual bool ops (BaseType *b, int op)
void parse_error (const char *msg, const int line_num, const char *context)
virtual void print_dap4 (XMLWriter &xml, bool constrained=false)
virtual void print_decl (FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
virtual void print_decl (ostream &out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
virtual void print_one_row (ostream &out, int row, string space, bool print_row_num=false)
virtual void print_usage () const
 Print usage information for a filter program.
virtual void print_val_by_rows (ostream &out, string space="", bool print_decl_p=true, bool print_row_numbers=true)
void print_var_das (ostream &out, BaseType *bt, string indent="")
virtual void print_xml (FILE *out, string space=" ", bool constrained=false)
virtual void print_xml (ostream &out, string space=" ", bool constrained=false)
virtual void print_xml_writer (XMLWriter &xml, bool constrained=false)
virtual int process_options (int argc, char *argv[])
virtual BaseTypeprototype () const
string prune_spaces (const string &name)
virtual BaseTypeptr_duplicate ()=0
virtual bool read ()
virtual bool read_next_instance (bool filter)
 Read the next instance of the sequence While the rest of the variables' read() methods are assumed to return the entire variable in one call (modulo enhancements of the library to support streaming large variables), this class assumes that the underlying data store is returning data from a table of unknown size. Thus, D4Sequence::read() is assumed to return one instance (or element or row) of the sequence per call and return true when the EOF (end of the sequence) is reached.
virtual bool read_p ()
 Has this variable been read?
string remove_quotes (const string &s)
string remove_space_encoding (const string &s)
virtual void reserve_value_capacity ()
virtual void reserve_value_capacity (unsigned int numElements)
virtual void reserve_value_capacity_ll ()
virtual void reserve_value_capacity_ll (uint64_t numElements)
virtual void reserve_value_capacity_ll_byte (uint64_t numBytes)
virtual D4SeqRowrow_value (size_t row)
 Get a whole row from the sequence.
void save_str (std::string &dst, const char *src, const int)
 Save a string to a temporary variable during the parse.
virtual void send_das (DAS &das, const string &anc_location="", bool with_mime_headers=true) const
virtual void send_das (FILE *out, DAS &das, const string &anc_location="", bool with_mime_headers=true) const
 Transmit a DAS.
virtual void send_das (ostream &out, DAS &das, const string &anc_location="", bool with_mime_headers=true) const
 Transmit a DAS.
virtual void send_data (DDS &dds, ConstraintEvaluator &eval, FILE *data_stream, const string &anc_location="", bool with_mime_headers=true) const
 Transmit a DDS.
virtual void send_data (DDS &dds, ConstraintEvaluator &eval, ostream &data_stream, const string &anc_location="", bool with_mime_headers=true) const
 Transmit data.
virtual void send_data_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &data_stream, const string &start, const string &boundary, const string &anc_location="", bool with_mime_headers=true) const
 Transmit data.
virtual void send_dds (DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const
virtual void send_dds (FILE *out, DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const
virtual void send_dds (ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained=false, const string &anc_location="", bool with_mime_headers=true) const
virtual void send_ddx (DDS &dds, ConstraintEvaluator &eval, FILE *out, bool with_mime_headers=true) const
virtual void send_ddx (DDS &dds, ConstraintEvaluator &eval, ostream &out, bool with_mime_headers=true) const
virtual bool send_p ()
 Should this variable be sent?
virtual void send_version_info () const
 Send version information back to the client program.
void set_array_using_double (Array *dest, double *src, int src_len)
virtual void set_attr_table (const AttrTable &at)
virtual void set_ce (string _ce)
virtual void set_cgi_version (string version)
virtual void set_dataset_name (const string _dataset)
virtual void set_in_selection (bool state)
virtual void set_is_dap4 (const bool v)
virtual void set_length (int64_t)
 Set the number of elements for this variable. use -1 to indicate nothing set.
virtual void set_length_ll (int64_t)
 Set the number of elements in this variable This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values.
virtual void set_name (const string &n)
virtual void set_parent (BaseType *parent)
virtual BaseTypeset_prototype (BaseType *btp)
 Change the Vector/Array element type.
virtual void set_read_p (bool state)
virtual void set_response (const string &r)
virtual void set_send_p (bool state)
virtual void set_synthesized_p (bool state)
void set_timeout (int timeout=0)
virtual void set_type (const Type &t)
virtual void set_URL (const string &url)
virtual void set_value (D4SeqValues &values)
 Set the internal value. The 'values' of a D4Sequence is a vector of vectors of BaseType* objects. Using this method does not perform a deep copy; the BaseType*s are copied so the caller should not free them. Note that this does set d_length but the read_p flag for the BaseTypes should all be set to keep the serializer from trying to read each of them.
virtual bool set_value (dods_byte *val, int sz)
virtual bool set_value (dods_float32 *val, int sz)
virtual bool set_value (dods_float64 *val, int sz)
virtual bool set_value (dods_int16 *val, int sz)
virtual bool set_value (dods_int32 *val, int sz)
virtual bool set_value (dods_int64 *val, int sz)
virtual bool set_value (dods_int8 *val, int sz)
virtual bool set_value (dods_uint16 *val, int sz)
virtual bool set_value (dods_uint32 *val, int sz)
virtual bool set_value (dods_uint64 *val, int sz)
virtual bool set_value (string *val, int sz)
virtual bool set_value (vector< dods_byte > &val, int sz)
virtual bool set_value (vector< dods_float32 > &val, int sz)
virtual bool set_value (vector< dods_float64 > &val, int sz)
virtual bool set_value (vector< dods_int16 > &val, int sz)
virtual bool set_value (vector< dods_int32 > &val, int sz)
virtual bool set_value (vector< dods_int64 > &val, int sz)
virtual bool set_value (vector< dods_int8 > &val, int sz)
virtual bool set_value (vector< dods_uint16 > &val, int sz)
virtual bool set_value (vector< dods_uint32 > &val, int sz)
virtual bool set_value (vector< dods_uint64 > &val, int sz)
virtual bool set_value (vector< string > &val, int sz)
void set_value_capacity (uint64_t l)
virtual bool set_value_ll (dods_byte *val, int64_t sz)
virtual bool set_value_ll (dods_float32 *val, int64_t sz)
virtual bool set_value_ll (dods_float64 *val, int64_t sz)
virtual bool set_value_ll (dods_int16 *val, int64_t sz)
virtual bool set_value_ll (dods_int32 *val, int64_t sz)
virtual bool set_value_ll (dods_int64 *val, int64_t sz)
virtual bool set_value_ll (dods_int8 *val, int64_t sz)
virtual bool set_value_ll (dods_uint16 *val, int64_t sz)
virtual bool set_value_ll (dods_uint32 *val, int64_t sz)
virtual bool set_value_ll (dods_uint64 *val, int64_t sz)
virtual bool set_value_ll (string *val, int64_t sz)
virtual bool set_value_ll (vector< dods_byte > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_float32 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_float64 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_int16 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_int32 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_int64 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_int8 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_uint16 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_uint32 > &val, int64_t sz)
virtual bool set_value_ll (vector< dods_uint64 > &val, int64_t sz)
virtual bool set_value_ll (vector< string > &val, int64_t sz)
virtual uint64_t set_value_slice_from_row_major_vector (const Vector &rowMajorData, uint64_t startElement)
void set_vec (unsigned int i, BaseType *val)
 Sets element i to value val.
void set_vec_ll (uint64_t i, BaseType *val)
void set_vec_nocopy (unsigned int i, BaseType *val)
 Sets element i to value val. Set the ith element to val. Extend the vector if needed.
void set_vec_nocopy_ll (uint64_t i, BaseType *val)
template<class T1, class T2>
bool StrCmp (int op, T1 v1, T2 v2)
AttrType String_to_AttrType (const string &s)
D4AttributeType StringToD4AttributeType (string s)
virtual bool synthesized_p ()
string systime ()
virtual void transfer_attributes (AttrTable *at)
virtual Type type () const
virtual string type_name () const
 Returns the type of the class instance as a string.
string type_name (Type t)
string unescape_double_quotes (string source)
string unescattr (string s)
string unhexstring (string s)
bool unique_names (vector< BaseType * > l, const string &var_name, const string &type_name, string &msg)
string unoctstring (string s)
int64_t val2buf_ll (void *val, bool reuse=false)
virtual D4SeqValues value () const
 Get the values for this D4Sequence This method returns a reference to the values held by the instance. You should make sure that the instance really holds values before calling it! Do not free the BaseType*s contained in the vector of vectors.
virtual void value (dods_byte *b) const
virtual void value (dods_float32 *b) const
virtual void value (dods_float64 *b) const
virtual void value (dods_int16 *b) const
virtual void value (dods_int32 *b) const
virtual void value (dods_int64 *b) const
virtual void value (dods_int8 *b) const
virtual void value (dods_uint16 *b) const
virtual void value (dods_uint32 *b) const
virtual void value (dods_uint64 *b) const
virtual void value (vector< string > &b) const
virtual void value (vector< unsigned int > *index, vector< string > &b) const
virtual void value (vector< unsigned int > *indices, dods_byte *b) const
virtual void value (vector< unsigned int > *indices, dods_float32 *b) const
virtual void value (vector< unsigned int > *indices, dods_float64 *b) const
virtual void value (vector< unsigned int > *indices, dods_int16 *b) const
virtual void value (vector< unsigned int > *indices, dods_int32 *b) const
virtual void value (vector< unsigned int > *indices, dods_int64 *b) const
virtual void value (vector< unsigned int > *indices, dods_int8 *b) const
virtual void value (vector< unsigned int > *indices, dods_uint16 *b) const
virtual void value (vector< unsigned int > *indices, dods_uint32 *b) const
virtual void value (vector< unsigned int > *indices, dods_uint64 *b) const
virtual void value_ll (vector< uint64_t > *index, vector< string > &b) const
virtual void value_ll (vector< uint64_t > *indices, dods_byte *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_float32 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_float64 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_int16 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_int32 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_int64 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_int8 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_uint16 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_uint32 *b) const
virtual void value_ll (vector< uint64_t > *indices, dods_uint64 *b) const
virtual D4SeqValuesvalue_ref ()
 Get the sequence values by reference This method returns a reference to the D4Sequence's values, eliminating the copy of all the pointers. For large sequences, that could be a substantial number of values (even though they are 'just' pointers).
virtual BaseTypevar (const string &name, btp_stack &s)
virtual BaseTypevar (const string &name="", bool exact_match=true, btp_stack *s=nullptr)
 Returns a pointer to a member of a constructor class.
virtual BaseTypevar (unsigned int i)
virtual BaseTypevar_ll (uint64_t i)
virtual BaseTypevar_value (size_t row, const string &name)
 Get the BaseType pointer to the named variable of a given row.
virtual BaseTypevar_value (size_t row, size_t i)
 Get the BaseType pointer to the $i^{th}$ variable of row.
void vec_resize (int l)
void vec_resize_ll (int64_t l)
virtual unsigned int width (bool constrained=false) const override
 Returns the width of the data, in bytes.
virtual int64_t width_ll (bool constrained=false) const override
 Return the number of bytes needed to hold the array data.
string www2id (const string &in, const string &escape, const string &except)
string xml2id (string in)
virtual void set_attributes (D4Attributes *)
virtual void set_attributes_nocopy (D4Attributes *)
Abstract Methods
virtual unsigned int buf2val (void **val)=0
 Reads the class data.
virtual unsigned int val2buf (void *val, bool reuse=false)=0
 Loads class data.
virtual void intern_data (ConstraintEvaluator &eval, DDS &dds)
virtual bool serialize (ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
 Move data to the net, then remove them from the object.
virtual void compute_checksum (Crc32 &checksum)=0
 include the data for this variable in the checksum DAP4 includes a checksum with every data response. This method adds the variable's data to that checksum.
virtual void intern_data ()
virtual void serialize (D4StreamMarshaller &m, DMR &dmr, bool filter=false)
 The DAP4 serialization method. Serialize a variable's values for DAP4. This does not write the DMR persistent representation but does write that part of the binary data blob that holds a variable's data. Once a variable's data are serialized, that memory is reclaimed (by calling BaseType::clear_local_data()).
virtual bool deserialize (UnMarshaller &um, DDS *dds, bool reuse=false)
 Receive data from the net.
virtual void deserialize (D4StreamUnMarshaller &um, DMR &dmr)
virtual void print_val (FILE *out, string space="", bool print_decl_p=true)
 Prints the value of the variable.
virtual void print_val (ostream &out, string space="", bool print_decl_p=true)=0
 Prints the value of the variable.
virtual bool is_dap4_projected (std::vector< string > &projected_dap4_inventory)
Accessors and Mutators for various properties.
bool is_hop_by_hop_header (const string &header)
Cache Index

These methods manage the cache's index file. Each cache holds an index file named .index which stores the cache's state information.

MIME Utilities

A collection of useful functions for writing MIME headers for OPeNDAP servers.

The CGI utilities include a variety of functions useful to programmers developing OPeNDAP CGI filter programs. However, before jumping in and using these, look at the class ResponseBuilder. Always choose to use that class over these functions if you can. Many of these functions were used by the CGI programs that made up the first DAP server; all of those are deprecated and the ResponseBuilder class should be used instead. Some of the other functions are used by ResponseBuilder and the client-side parsing code that needs to identify MIME headers, boundaries, etc.

See also
ResponseBuilder, Connect, DDXParserSAX2
time_t last_modified_time (const string &name)
string rfc822_date (const time_t t)
bool do_version (const string &script_ver, const string &dataset_ver)
 Send a version number.
void ErrMsgT (const string &Msgt)
 Logs an error message.
string name_path (const string &path)
 Returns the filename portion of a pathname.
ObjectType get_type (const string &value)
ObjectType get_description_type (const string &value)
string get_next_mime_header (FILE *in)
string get_next_mime_header (istream &in)
void parse_mime_header (const string &header, string &name, string &value)
bool is_boundary (const char *line, const string &boundary)
string read_multipart_boundary (FILE *in, const string &boundary)
string read_multipart_boundary (istream &in, const string &boundary)
void read_multipart_headers (FILE *in, const string &content_type, const ObjectType object_type, const string &cid)
void read_multipart_headers (istream &in, const string &content_type, const ObjectType object_type, const string &cid)
string cid_to_header_value (const string &cid)
void remove_mime_header (istream &in)
 Send a `Not Modified' response.
bool remove_mime_header (FILE *in)
MIME utility functions

These functions are used to create the MIME headers for a message from a server to a client. They are public but should not be called directly unless absolutely necessary. Use DODSFilter instead.

NB: These functions actually write both the response status line and the header.

Deprecated
Use ResponseBuilder instead.
See also
DODSFilter
void set_mime_text (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_text (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_text (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol)
void set_mime_html (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_html (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_html (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol)
void set_mime_binary (FILE *out, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_binary (ostream &strm, ObjectType type, const string &ver, EncodingType enc, const time_t last_modified)
void set_mime_binary (ostream &strm, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol)
void set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, const string &version, EncodingType enc, const time_t last_modified)
void set_mime_multipart (ostream &strm, const string &boundary, const string &start, ObjectType type, EncodingType enc, const time_t last_modified, const string &protocol, const string &url)
void set_mime_ddx_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc)
void set_mime_data_boundary (ostream &strm, const string &boundary, const string &cid, ObjectType type, EncodingType enc)
void set_mime_error (FILE *out, int code, const string &reason, const string &version)
void set_mime_error (ostream &strm, int code, const string &reason, const string &version)
void set_mime_not_modified (FILE *out)
void set_mime_not_modified (std::ostream &out)
parse_error

Generate error messages for the various parsers.

parser_error() generates error messages for the various parsers used by libdap. There are two versions of the function, one which takes a const char *message and a const int line_num and writes the message and line number too stderr and a second which takes an additional parser_arg arg parameter and writes the error message into an Error object which is returned to the caller via the arg parameter.

Note
{The second version of this function also accepts a third parameter (const char *context) which can be used to provide an additional line of information beyond what is in the string message.}
Returns
void
void parse_error (parser_arg *arg, const char *msg, const int line_num, const char *context)
void parse_error (const string &msg, const int line_num, const char *context)
Double to string conversion functions

Jose Garcia /** Conversions from double to a character representation which gets appended to a string. This function depends on the standard routine sprintf to convert a double to a textual representation which gets appended to the string 'str'.

Parameters
numThe double you wish to append to str.
strThe string where the textual representation of num will be appended.
Returns
void.
void append_double_to_string (const double &num, string &str)
string double_to_string (const double &num)
string path_to_filename (string path)
int glob (const char *c, const char *s)
time_t parse_time (const char *str, bool expand)
Security functions
bool size_ok (unsigned int sz, unsigned int nelem)
 sanitize the size of an array. Test for integer overflow when dynamically allocating an array.
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 valid name. We define this as: Contains only printable characters; and Is less then 256 characters. If strict is true, test that the pathname consists of only letters, digits, and underscore, dash and dot characters instead of the more general case where a pathname can be composed of any printable characters.
string dap_version ()
string open_temp_fstream (ofstream &f, const string &name_template, const string &suffix)

Variables

const string c_dap40_namespace = "http://xml.opendap.org/ns/DAP/4.0#"
string d_action
time_t d_anc_das_lmt
time_t d_anc_dds_lmt
string d_anc_dir
string d_anc_file
bool d_bad_options
string d_cache_dir
string d_cgi_ver
bool d_comp
bool d_conditional_request
string d_dap2ce
string d_dataset
time_t d_if_modified_since
string d_program_name
Response d_response
int d_timeout
string d_url
int dods_keep_temps = 0
const int DODS_MAX_ARRAY = DODS_INT_MAX
const size_t line_length = 1024
const unsigned int max_str_len = DODS_USHRT_MAX - 1
const unsigned int max_url_len = 255
const string usage
int www_trace = 0
int www_trace_extensive = 0

get information using an iterator

const string double_quote = "\""

Detailed Description

top level DAP object to house generic methods

Define this symbol iff we decide to include information about the byte order of the response (as sent from the server) so that the client can determine the correct CRC32 hash code. jhrg 1/4/16

Typedef Documentation

◆ BaseTypeRow

The type BaseTypeRow is used to store single rows of values in an instance of Sequence. Values are stored in instances of BaseType.

Definition at line 49 of file D4Sequence.h.

◆ byte_arg_list

typedef std::vector<dods_byte>* libdap::byte_arg_list

Definition at line 73 of file RValue.h.

◆ D4Function

typedef BaseType *(* libdap::D4Function) (D4RValueList *, DMR &)

Definition at line 41 of file D4Function.h.

◆ D4SeqRow

The type BaseTypeRow is used to store single rows of values in an instance of D4Sequence. Values are stored in instances of BaseType.

Definition at line 42 of file D4Sequence.h.

◆ D4SeqValues

This type holds all of the values of a D4Sequence.

Definition at line 45 of file D4Sequence.h.

◆ dods_byte

typedef uint8_t libdap::dods_byte

Definition at line 20 of file dods-datatypes-static.h.

◆ dods_enum

typedef int64_t libdap::dods_enum

Definition at line 33 of file dods-datatypes-static.h.

◆ dods_float32

typedef float libdap::dods_float32

Definition at line 24 of file dods-datatypes-static.h.

◆ dods_float64

typedef double libdap::dods_float64

Definition at line 22 of file dods-datatypes-static.h.

◆ dods_int16

typedef int16_t libdap::dods_int16

Definition at line 16 of file dods-datatypes-static.h.

◆ dods_int32

typedef int32_t libdap::dods_int32

Definition at line 12 of file dods-datatypes-static.h.

◆ dods_int64

typedef int64_t libdap::dods_int64

Definition at line 29 of file dods-datatypes-static.h.

◆ dods_int8

typedef int8_t libdap::dods_int8

Definition at line 27 of file dods-datatypes-static.h.

◆ dods_uint16

typedef uint16_t libdap::dods_uint16

Definition at line 18 of file dods-datatypes-static.h.

◆ dods_uint32

typedef uint32_t libdap::dods_uint32

Definition at line 14 of file dods-datatypes-static.h.

◆ dods_uint64

typedef uint64_t libdap::dods_uint64

Definition at line 31 of file dods-datatypes-static.h.

◆ ErrorCode

typedef int libdap::ErrorCode

An enumerated type for common errors.

The most common errors within DAP2 have special codes so that they can be spotted easily by the client software. Any error without a matching code gets the unknown_error code.

Definition at line 57 of file Error.h.

◆ float32_arg_list

typedef std::vector<dods_float32>* libdap::float32_arg_list

Definition at line 78 of file RValue.h.

◆ float64_arg_list

typedef std::vector<dods_float64>* libdap::float64_arg_list

Definition at line 79 of file RValue.h.

◆ int16_arg_list

typedef std::vector<dods_int16>* libdap::int16_arg_list

Definition at line 74 of file RValue.h.

◆ int32_arg_list

typedef std::vector<dods_int32>* libdap::int32_arg_list

Definition at line 76 of file RValue.h.

◆ rvalue_list

typedef std::vector<rvalue *> libdap::rvalue_list

Definition at line 69 of file RValue.h.

◆ rvalue_list_citer

typedef std::vector<rvalue*>::const_iterator libdap::rvalue_list_citer

Definition at line 70 of file RValue.h.

◆ rvalue_list_iter

typedef std::vector<rvalue*>::iterator libdap::rvalue_list_iter

Definition at line 71 of file RValue.h.

◆ SequenceValues

This type holds all of the values of a Sequence.

Definition at line 52 of file D4Sequence.h.

◆ Sigfunc

typedef void libdap::Sigfunc(int)

Definition at line 37 of file SignalHandler.h.

◆ uint16_arg_list

typedef std::vector<dods_uint16>* libdap::uint16_arg_list

Definition at line 75 of file RValue.h.

◆ uint32_arg_list

typedef std::vector<dods_uint32>* libdap::uint32_arg_list

Definition at line 77 of file RValue.h.

Enumeration Type Documentation

◆ AttrType

AttrType identifies the data types which may appear in an attribute table object.

enum AttrType {
Attr_unknown,
Attr_container,
Attr_byte,
Attr_int16,
Attr_uint16,
Attr_int32,
Attr_uint32,
Attr_float32,
Attr_float64,
Attr_string,
Attr_url,
Attr_other_xml
};
See also
AttrTable

Definition at line 78 of file AttrTable.h.

◆ CacheDisconnectedMode

Disconnected Operation

The cache can be set to handle disconnected operation where it does not use the network to validate entries and does not attempt to load new documents. All requests that cannot be fulfilled by the cache will be returned with a "504 Gateway Timeout" response. There are two operational disconnected modes:

No network activity at all: Here it uses its own persistent cache to answer the request, if possible.

Forward all disconnected requests to a proxy cache: Here it uses the HTTP/1.1 cache-control header to indicate that the proxy should operate in disconnected mode.

Definition at line 46 of file HTTPCacheDisconnectedMode.h.

◆ DAPVersion

enum libdap::DAPVersion

Definition at line 32 of file DapXmlNamespaces.h.

◆ EncodingType

The type of encoding used on the current stream.

libdap understands two types of encoding: x-plain and deflate, which correspond to plain uncompressed data and data compressed with zlib's LZW algorithm respectively.

enum EncodingType { unknown_enc, deflate, x_plain, gzip, binary };

Definition at line 47 of file EncodingType.h.

◆ ObjectType

The type of object in the stream coming from the data server.

When a version 2.x or greater DAP data server sends an object, it may use the Content-Description header of the response to indicate the type of object contained in the response.

 enum ObjectType {
   unknown_type,
   dods_das,
   dods_dds,
   dods_data,
   dods_ddx,
   dods_data_ddx,
   dods_error,
   web_error,

   dap4_dmr,
   dap4_data,
   dap4_error,
 };
 
Note
If this is cjanged, update the char* array 'descrip' in mime_util.h.

Definition at line 57 of file ObjectType.h.

◆ Part

Names the parts of multi-section constructor data types.

Part names the parts of multi-section constructor types. For example, the Grid class has an array and the array maps. Use the nil value for data types that don't have separate parts.

enum Part {
nil,
array,
maps
};
Part
Names the parts of multi-section constructor data types.
Definition Type.h:48
See also
Grid
BaseType

Definition at line 48 of file Type.h.

◆ RejectReasonCode

enum libdap::RejectReasonCode

Definition at line 15 of file D4AsyncUtil.h.

◆ Response

enum libdap::Response

Common functions for DODS server filter programs.

When a DODS server receives a request from a DODS client, the server CGI script dispatches the request to one of several ``filter'' programs. Each filter is responsible for returning a different aspect of the dataset information: one is for data, one is for the dataset DDS, one is for the dataset DAS, and a fourth is for a usage message describing the server itself. Some installations may have additional optional filters.

The filter program receives a data request from the dispatch script. It receives its operating parameters from the command line, like any UNIX command, and it returns its output to standard output, which the httpd server packages up into a reply to the client.

This class contains some common functions for the filter programs used to make up the DODS data servers. The filter programs do not have to be called by a CGI program, but that is the normal mechanism by which they are invoked.

Todo

Add a test to make sure that the required arguments are given.

We need to rethink the ancillary file/directory stuff. I don't think it's ever been used...

Author
jhrg 8/26/97 */

class DODSFilter { public: /** Types of responses DODSFilter know about.

Definition at line 80 of file DODSFilter.h.

◆ Type

Identifies the data type.

Type identifies the data type stored in a particular type class. All the DODS Data Access Protocol (DAP) types inherit from the BaseType class.

enum Type {
dods_null_c,
dods_byte_c,
dods_int16_c,
dods_uint16_c,
dods_int32_c,
dods_uint32_c,
dods_float32_c,
dods_float64_c,
dods_str_c,
dods_url_c,
dods_structure_c,
dods_array_c,
dods_sequence_c,
dods_grid_c,
dods_char_c,
dods_int8_c,
dods_uint8_c,
dods_int64_c,
dods_uint64_c,
dods_enum_c,
dods_opaque_c,
dods_group_c
};
Type
Identifies the data type.
Definition Type.h:94
See also
BaseType

Definition at line 94 of file Type.h.

Function Documentation

◆ add_space_encoding()

string libdap::add_space_encoding ( const string & s)

Add %20 space encoding.

Definition at line 76 of file AttrTable.cc.

◆ append_double_to_string()

void libdap::append_double_to_string ( const double & num,
string & str )

Definition at line 953 of file util.cc.

◆ append_long_to_string()

void libdap::append_long_to_string ( long val,
int base,
string & str_val )

Definition at line 919 of file util.cc.

◆ append_rvalue_list()

rvalue_list * libdap::append_rvalue_list ( rvalue_list * rvals,
rvalue * rv )

Definition at line 66 of file RValue.cc.

◆ AttrType_to_String()

string libdap::AttrType_to_String ( const AttrType at)

Convert an AttrType to it's string representation.

Parameters
atThe Attribute Type.
Returns
The type's string representation

Definition at line 93 of file AttrTable.cc.

◆ buf2val()

unsigned int libdap::buf2val ( void ** val)
overridepure virtual

Reads the class data.

Reads the class data into the memory referenced by val. The caller should either allocate enough storage to val to hold the class data or set *val to null. If *val is NULL, memory will be allocated by this function with new(). If the memory is allocated this way, the caller is responsible for deallocating that memory. Array and values for simple types are stored as C would store an array.

Deprecated
Use value() in the leaf classes.
Parameters
valA pointer to a pointer to the memory into which the class data will be copied. If the value pointed to is NULL, memory will be allocated to hold the data, and the pointer value modified accordingly. The calling program is responsible for deallocating the memory references by this pointer.
Returns
The size (in bytes) of the information copied to val.

◆ buf2val_ll()

int64_t Vector::buf2val_ll ( void ** val)

Definition at line 1479 of file Vector.cc.

◆ build_btp_args()

BaseType ** libdap::build_btp_args ( const rvalue_list * args,
DDS & dds )

Build an argument list suitable for calling a btp_func, bool_func, and so on. Since this takes an rvalue_list and not an rvalue, it is a function rather than a class member.

This function performs a common task but does not fit within the RValue class well. It is used by Clause and ce_expr.y.

Parameters
argsA list of RValue objects
ddsUse this DDS when evaluating functions

Definition at line 82 of file RValue.cc.

◆ cid_to_header_value()

std::string libdap::cid_to_header_value ( const string & cid)

Given a Content-Id read from the DDX, return the value to look for in a MPM Content-Id header. This function downcases the CID to match the value returned by parse_mime_header.

Parameters
cidThe Content-Id read from the DDX
Returns
The header value to look for.
Exceptions
Errorif the CID does not start with the string "cid:"

Definition at line 1008 of file mime_util.cc.

◆ clauses()

D4FilterClauseList & libdap::D4Sequence::clauses ( )

Access the filter clauses for this D4Sequence.

When a filter is supplied with a DAP4 constraint, the expression is parsed and one or more D4FilterClause objects are built and stored in a D4FilterClauseList bound to the D4Sequence to be filtered.

Returns
A reference to this D4Sequence's filter clause list
See also
D4FilterClauseList

Definition at line 328 of file D4Sequence.cc.

◆ clear_local_data()

void libdap::clear_local_data ( )
overridevirtual

The basic data type for the DODS DAP types. */.

This defines the basic data type features for the DODS data access protocol (DAP) data types. All the DAP type classes (Float64, Array, etc.) subclass it. This class is an abstract one; no variables will ever be stored as BaseType instances, only as instances of its child classes.

These classes and their methods give a user the capacity to set up sophisticated data types. They do not provide sophisticated ways to access and use this data. On the server side, in many cases, the class instances will have no data in them at all until the serialize function is called to send data to the client. On the client side, most DAP application programs will unpack the data promptly into whatever local data structure the programmer deems the most useful.

In order to use these classes on the server side of a DAP client/server connection, you must write a read method for each of the data types you expect to encounter in the application. This function, whose purpose is to read data from a local source into the class instance data buffer, is called in serialize, when the data is about to be sent to the client. The read function may be called earlier, in the case of data subset requests (constraint expressions) whose evaluation requires it. (For example, the constraint expression ``a,b&b>c'' requires that c be read even though it will not be sent.)

For some data types, the read function must be aware of the constraints to be returned. These cautions are outlined where they occur.

Note
This class is ued by both DAP2 and DAP4.

class BaseType : public DapObj { private: string d_name; // name of the instance Type d_type; // instance's type string d_dataset; // name of the dataset used to create this BaseType

bool d_is_read; // true if the value has been read bool d_is_send; // Is the variable in the projection?

d_parent points to the Constructor or Vector which holds a particular variable. It is null for simple variables. The Vector and Constructor classes must maintain this variable. BaseType *d_parent;

Attributes for this variable. Added 05/20/03 jhrg AttrTable d_attr;

D4Attributes *d_attributes;

bool d_is_dap4; // True if this is a DAP4 variable, false ... DAP2

These are non-empty only for DAP4 variables. Added 9/27/12 jhrg

These were/are used for DAP2 CEs, but not for DAP4 ones bool d_in_selection; // Is the variable in the selection? bool d_is_synthesized; // true if the variable is synthesized

protected: void m_duplicate(const BaseType &bt);

public: typedef stack<BaseType *> btp_stack;

These ctors assume is_dap4 is false BaseType(const string &n, const Type &t, bool is_dap4 = false); BaseType(const string &n, const string &d, const Type &t, bool is_dap4 = false);

BaseType(const BaseType &copy_from); ~BaseType() override;

virtual string toString();

virtual void transform_to_dap4(D4Group *root, Constructor *container); virtual std::vector<BaseType *> *transform_to_dap2(AttrTable *parent_attr_table);

void dump(ostream &strm) const override;

BaseType &operator=(const BaseType &rhs);

/** Remove any read or set data in the private data of the variable, setting read_p() to false. Used to clear any dynamically allocated storage that holds (potentially large) data. For the simple types, this no-op version is all that's needed. Vector and some other classes define a special version and have serialize() implementations that call it to free data as soon as possible after sending it.

Note
Added 7/5/15 jhrg
Any specialization of this should make sure to reset the read_p property.

Definition at line 179 of file BaseType.h.

◆ close_temp()

void libdap::close_temp ( FILE * s,
const string & name )

close temporary files - used here and in ~HTTPResponse

Parameters
s
name

Definition at line 760 of file HTTPConnect.cc.

◆ Cmp()

template<class T1, class T2>
bool libdap::Cmp ( int op,
T1 v1,
T2 v2 )

Compare two numerical types, both of which are either signed or unsigned. This class is one implementation of the comparison policy used by rops.

See also
rops
USCmp
SUCmp

Definition at line 52 of file Operators.h.

◆ compute_checksum()

void libdap::compute_checksum ( Crc32 & checksum)
overridepure virtual

include the data for this variable in the checksum DAP4 includes a checksum with every data response. This method adds the variable's data to that checksum.

Parameters
checksumA Crc32 instance that holds the current checksum.

◆ D2type_name()

string libdap::D2type_name ( Type t)

Returns the type of the class instance as a string. Supports all DAP2 types and not the DAP4-only types. Also returns Url (DAP2) and not "URL" (DAP4) for the URL type.

Parameters
tThe type code
Returns
The type name in a string

Definition at line 644 of file util.cc.

◆ D4AttributeTypeToString()

string libdap::D4AttributeTypeToString ( D4AttributeType at)

Convert an AttrType to it's string representation.

Parameters
atThe Attribute Type.
Returns
The type's string representation

Definition at line 45 of file D4Attributes.cc.

◆ D4RValueFactory()

D4RValue * libdap::D4RValueFactory ( std::string cpps)

Build an appropriate RValue.

Look at the value in the string parameter and build an appropriate BaseType, use that as a constant and build an RValue. This can be used by the DAP4 parser directly to build the constants in filter clauses.

Parameters
cppsThe string argument read by the parser.
Returns
A D4RValue pointer.

Definition at line 197 of file D4RValue.cc.

◆ D4type_name()

string libdap::D4type_name ( Type t)

Returns the type of the class instance as a string. Supports all DAP4 types and not the DAP2-only types. Also returns URL (DAP4) and not "Url" (DAP2) for the URL type.

Parameters
tThe type code
Returns
The type name in a string

Definition at line 688 of file util.cc.

◆ dap_version()

string libdap::dap_version ( )

Get the version of the DAP library.

Deprecated

Definition at line 1198 of file util.cc.

◆ dataset()

string BaseType::dataset ( ) const
virtual

Returns the name of the dataset used to create this instance.

A dataset from which the data is to be read. The meaning of this string will vary among different types of data sources. It may be the name of a data file or an identifier used to read data from a relational database.

Definition at line 326 of file BaseType.cc.

◆ date_time_str()

std::string libdap::date_time_str ( time_t * calendar,
bool local )

Given a time in seconds since midnight 1 Jan 1970, return the RFC 1123 date string. Example result string: Sun, 06 Nov 1994 08:49:37 GMT

Parameters
calendarTime in seconds
localIf true, return the local time, if false return GMT. The default value is false.
Returns
A RFC 1123 date string.

Definition at line 260 of file util_mit.cc.

◆ deserialize() [1/2]

void libdap::deserialize ( D4StreamUnMarshaller & um,
DMR & dmr )
overridevirtual

The DAP4 deserialization method.

Parameters
um
dmr
Exceptions
Erroror InternalErr

◆ deserialize() [2/2]

bool libdap::deserialize ( UnMarshaller & um,
DDS * dds,
bool reuse = false )
overridevirtual

Receive data from the net.

Receives data from the network connection identified by the source parameter. The data is put into the class data buffer according to the input dds.

This function is only used on the client side of the DODS client/server connection.

Parameters
umAn UnMarshaller that knows how to deserialize data types
ddsThe Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure. This would have been received from the server in an earlier transmission.
reuseA boolean value, indicating whether the class internal data storage can be reused or not. If this argument is TRUE, the class buffer is assumed to be large enough to hold the incoming data, and it is not reallocated. If FALSE, new storage is allocated. If the internal buffer has not been allocated at all, this argument has no effect.
Returns
Always returns TRUE.
Exceptions
Errorwhen a problem reading from the UnMarshaller is found.
See also
DDS

Definition at line 206 of file D4Sequence.h.

◆ dir_exists()

bool libdap::dir_exists ( const string & dir)

Does the directory exist?

Parameters
dirThe pathname to test.
Returns
True if the directory exists, false otherwise

Definition at line 912 of file util.cc.

◆ do_version()

bool libdap::do_version ( const string & script_ver,
const string & dataset_ver )

Send a version number.

This sends a formatted block of text to the client, containing version information about various aspects of the server. The arguments allow you to enclose version information about the filter program and the dataset in the message. Either argument (or both) may be omitted, in which case no script or dataset version information will be printed.

Parameters
script_verThe version of the filter script executing this function.
dataset_verThe version of the dataset.
Returns
TRUE for success. Always returns true.

Definition at line 178 of file mime_util.cc.

◆ DODSFilter() [1/2]

libdap::DODSFilter ( )

Make an empty instance. Use the set_*() methods to load with needed values. You must call at least set_dataset_name() or be requesting version information.

Todo
Add methods to provide a way to set all of the parameters this class contains. They can currently only be set using the argc/argv command line parameters.

Definition at line 127 of file DODSFilter.h.

◆ DODSFilter() [2/2]

libdap::DODSFilter::DODSFilter ( int argc,
char * argv[] )

DODSFilter constructor.

Create an instance of DODSFilter using the command line arguments passed by the CGI (or other) program. The default constructor is private; this and the copy constructor (which is just the default copy constructor) are the only way to create an instance of DODSFilter.

These are the valid options:

filename

The name of the file on which the filter is to operate. Usually this would be the file whose data has been requested. In fact, this class can be specialized and any meaning can be associated to this string. It could be the name of a database, for example.

-o response

Specifies the type of response desired. The response is a string and must be one of DAS, DDS, DataDDS or Version. Note that Version returns version information in the body of the response and is useful for debugging, et cetera. Each response returns version information in an HTTP header for internal use by a client.

-c

Send compressed data. Data are compressed using the deflate program.

-e expression

This option specifies a non-blank constraint expression used to subsample a dataset.

-v cgi-version

Set the CGI/Server version to cgi-version. This is a way for the caller to set version information passed back to the client either as the response to a version request of in the response headers.

-d ancdir

Specifies that ancillary data be sought in the ancdir directory. ancdir must end in '/'.

-f ancfile

Specifies that ancillary data may be found in a file called ancfile.

-r cache directory

Specify a directory to use if/when files are to be cached. Not all handlers support caching and each uses its own rules tailored to a specific file or data type.

-t timeout

Specifies a a timeout value in seconds. If the server runs longer than timeout seconds, an Error is returned to the client explaining that the request has timed out.

-l time

Indicates that the request is a conditional request; send a complete response if and only if the data has changed since time. If it has not changed since time, then send a 304 (Not Modified) response. The time parameter is the Last-Modified time from an If-Modified-Since condition GET request. It is given in seconds since the start of the Unix epoch (Midnight, 1 Jan 1970).

Definition at line 168 of file DODSFilter.cc.

◆ double_eq()

bool libdap::double_eq ( double lhs,
double rhs,
double epsilon = 1.0e-5 )
inline

Is lhs equal to rhs? Use epsilon to determine equality.

Definition at line 54 of file util.h.

◆ double_to_string()

string libdap::double_to_string ( const double & num)

Definition at line 962 of file util.cc.

◆ downcase()

void libdap::downcase ( string & s)

Downcase the source string. This function modifies its argument.

Parameters
Thestring to modify

Definition at line 544 of file util.cc.

◆ ErrMsgT()

void libdap::ErrMsgT ( const string & Msgt)

Logs an error message.

Prints an error message in the httpd system log file, along with a time stamp and the client host name (or address).

Use this instead of the functions in liberrmsg.a in the programs run by the CGIs to report errors so those errors show up in HTTPD's log files.

Deprecated
Returns
void

Definition at line 209 of file mime_util.cc.

◆ escape_double_quotes()

string libdap::escape_double_quotes ( string source)

Rip through a string and replace all the double quotes with " sequences.

Parameters
source
Returns
result

Definition at line 466 of file escaping.cc.

◆ escattr()

string libdap::escattr ( string s)

Return a string that has all the %<hex digit><hex digit> sequences replaced with underscores (`_').

Parameters
sThe string to transform
Returns
The modified string. */ string esc2underscore(string s) { string::size_type pos; while ((pos = s.find('')) != string::npos) s.replace(pos, 3, "_");

return s; }

/** Escape non-printable characters and quotes from an HDF attribute.

Parameters
sThe attribute to modify.
Returns
The modified attribute.

Definition at line 342 of file escaping.cc.

◆ escattr_xml()

string libdap::escattr_xml ( string s)

Escape non-printable characters and quotes from an HDF attribute.

Parameters
sThe attribute to modify.
Returns
The modified attribute.

Definition at line 375 of file escaping.cc.

◆ establish_timeout() [1/2]

void libdap::DODSFilter::establish_timeout ( FILE * stream) const
virtual

Use values of this instance to establish a timeout alarm for the server. If the timeout value is zero, do nothing.

Todo
When the alarm handler is called, two CRLF pairs are dumped to the stream and then an Error object is sent. No attempt is made to write the 'correct' MIME headers for an Error object. Instead, a savvy client will know that when an exception is thrown during a deserialize operation, it should scan ahead in the input stream for an Error object. Add this, or a sensible variant once libdap++ supports reliable error delivery. Dumb clients will never get the Error object...

Definition at line 544 of file DODSFilter.cc.

◆ establish_timeout() [2/2]

void libdap::DODSFilter::establish_timeout ( ostream & stream) const
virtual

Definition at line 555 of file DODSFilter.cc.

◆ extract_double_array() [1/2]

double * libdap::extract_double_array ( Array * a)

Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] MUST be used when you are done the data.

Note
Support added for DAP4.
Parameters
aExtract value from this Array.
Returns
A C++/C array of doubles.

Definition at line 257 of file util.cc.

◆ extract_double_array() [2/2]

void libdap::extract_double_array ( Array * a,
vector< double > & dest )

Given a pointer to an Array which holds a numeric type, extract the values and return in an array of doubles. This function allocates the array using 'new double[n]' so delete[] MUST be used when you are done the data.

Note
Before you call this function, you must call read on the array, or load the array with values and set the read_p property.
Support added for DAP4.
Parameters
aExtract value from this Array.
destPut the values in this vector. A value-result parameter.
Returns
A C++/C array of doubles.

Definition at line 337 of file util.cc.

◆ extract_double_value()

double libdap::extract_double_value ( BaseType * arg)

Given a BaseType pointer, extract the numeric value it contains and return it in a C++ double.

Note
Support for DAP4 types added.
Parameters
argThe BaseType pointer
Returns
A C++ double
Exceptions
Errorthrown if the referenced BaseType object does not contain a DAP numeric value.

Definition at line 395 of file util.cc.

◆ extract_string_argument()

string libdap::extract_string_argument ( BaseType * arg)

Given a BaseType pointer, extract the string value it contains

Parameters
argThe BaseType pointer
Returns
A C++ string
Exceptions
Errorthrown if the referenced BaseType object does not contain a DAP String.

Definition at line 118 of file util.cc.

◆ fillConstructorAttrTable()

void libdap::fillConstructorAttrTable ( AttrTable * at,
BaseType * bt )

Recursive helper function for Building DAS entries for Constructor types.

Parameters
atAdd Constructor content to this Attribute table
btA pointer to a BaseType which may be an instance of Constructor.

Definition at line 998 of file DDS.cc.

◆ get_action()

string libdap::DODSFilter::get_action ( ) const
virtual

Get the string name of the response to be returned.

Definition at line 417 of file DODSFilter.cc.

◆ get_ancestor()

BaseType * BaseType::get_ancestor ( )
virtual

Definition at line 638 of file BaseType.cc.

◆ get_buf()

char * libdap::get_buf ( )

Holds a one-dimensional collection of DAP2 data types.

Holds a one-dimensional array of DAP2 data types. This class takes two forms, depending on whether the elements of the vector are themselves simple or compound objects. This class contains common functionality for the List and Array classes, and should rarely be used directly.

When each element of the class is a simple data type, the Vector is implemented as a simple array of C types, rather than as an array of BaseType data types. A single private ``template'' BaseType instance (_var) is used to hold information in common to all the members of the array. The template is also used as a container to pass values back and forth to an application program, as in var().

If the elements of the vector are themselves compound data types, the array is stored as a vector of BaseType pointers (see the libdap class BaseTypePtrVec). The template is still used to hold information in common to all the members of the array, but is not used to pass information to and from the application program.

See also
BaseType
Array */ class Vector : public BaseType { private: Add d_length_ll. This uses -1 as a sentinel value. jhrg 7/25/22 If we decide to add a bool for 'no values yet' do that as a separate refactor. jhrg 7/25/22 int64_t d_length_ll = -1; // number of elements in the vector

int d_length = -1; // number of elements in the vector BaseType *d_proto = nullptr; // element prototype for the Vector

_buf was a pointer to void; delete[] complained. 6/4/2001 jhrg char *d_buf = nullptr; // storage for cardinal data vector<string> d_str; // special storage for strings. jhrg 2/11/05 vector<BaseType *> d_compound_buf; // storage for data in compound types (e.g., Structure)

the number of elements we have allocated memory to store. This should be either the sizeof(buf)/width(bool constrained = false) for cardinal data or the capacity of d_str for strings or capacity of _vec. unsigned int d_capacity = 0; uint64_t d_capacity_ll = 0;

bool d_too_big_for_dap2 = false; /// Conditionally set to true in set_length_ll()

friend class MarshallerTest;

Made these template methods private because they can't be overridden anyways (because c++...) - ndp 08/14/2015 template <typename T> void value_worker(T *v) const; template <typename T> void value_ll_worker(T *v) const; template <typename T> void value_worker(vector<unsigned int> *indices, T *b) const; template <typename T> void value_ll_worker(vector<uint64_t> *indices, T *b) const;

template <typename T> bool set_value_worker(T *v, int sz); template <typename T> bool set_value_ll_worker(T *v, int64_t sz); template <typename T> bool set_value_worker(vector<T> &v, int sz); template <typename T> bool set_value_ll_worker(vector<T> &v, int64_t sz);

bool m_is_cardinal_type() const; int64_t m_create_cardinal_data_buffer_for_type(int64_t num_elements); void m_delete_cardinal_data_buffer(); template <class CardType> void m_set_cardinal_values_internal(const CardType *fromArray, int64_t num_elements);

This function copies the private members of Vector. void m_duplicate(const Vector &v);

public: Vector(const string &n, BaseType *v, const Type &t, bool is_dap4 = false); Vector(const string &n, const string &d, BaseType *v, const Type &t, bool is_dap4 = false); Vector(const Vector &rhs);

virtual ~Vector();

Vector &operator=(const Vector &rhs); FIXME BaseType *ptr_duplicate() = 0 override;

/** Provide access to internal data. Callers cannot delete this but can pass them to other methods.

Note
Added so that the NCML handler can code some optimizations in its specialized versions of Array. jhrg 8/14/15
Returns
A pointer to the data buffer for Vectors/Arrays of the cardinal types.

Definition at line 144 of file Vector.h.

◆ get_cache_dir()

string libdap::DODSFilter::get_cache_dir ( ) const
virtual

Get the cache directory.

The cache_dir is used to hold the cached .dds and .das files. By default, this returns an empty string (store cache files in current directory.

Returns
A string object that contains the cache file directory.

Definition at line 522 of file DODSFilter.cc.

◆ get_ce()

string libdap::DODSFilter::get_ce ( ) const
virtual

Get the constraint expression.

Return the entire constraint expression in a string. This includes both the projection and selection clauses, but not the question mark.

Returns
A string object that contains the constraint expression.

Definition at line 345 of file DODSFilter.cc.

◆ get_cgi_version()

string libdap::DODSFilter::get_cgi_version ( ) const
virtual

Set the CGI/Server version number. Servers use this when answering requests for version information. The version `number' should include both the name of the server (e.g., ff_dods) as well as the version number. Since this information is typically divined by configure, it's up to the executable to poke the correct value in using this method.

Note that the -v switch that this class understands is deprecated since it is usually called by Perl code. It makes more sense to have the actual C++ software set the version string.

Parameters
versionA version string for this server. */ void DODSFilter::set_cgi_version(string version) { d_cgi_ver = version; }

/** Return the version information passed to the instance when it was created. This string is passed to the DODSFilter ctor using the -v option.

Returns
The version string supplied at initialization.

Definition at line 337 of file DODSFilter.cc.

◆ get_compound_buf()

vector< BaseType * > & libdap::get_compound_buf ( )

Provide access to internal data by reference. Callers cannot delete this but can pass them to other methods.

Returns
A reference to a vector of BaseType pointers. Treat with care; never delete these!

Definition at line 161 of file Vector.h.

◆ get_dap2_AttrType()

AttrType libdap::get_dap2_AttrType ( D4AttributeType d4_type)

Definition at line 265 of file D4Attributes.cc.

◆ get_das_last_modified_time()

time_t libdap::DODSFilter::get_das_last_modified_time ( const string & anc_location = "") const
virtual

Get the dataset's last modified time. This returns the time at which the dataset was last modified as defined by UNIX's notion of modification. This does not take into account the modification of an ancillary DAS or DDS. Time is given in seconds since the epoch (1 Jan 1970 00:00:00 GMT).

This method perform a simple check on the file named by the dataset given when the DODSFilter instance was created. If the dataset is not a filter, this method returns the current time. Servers which provide access to non-file-based data should subclass DODSFilter and supply a more suitable version of this method.

From the stat(2) man page: ``Traditionally, st_mtime is changed by mknod(2), utime(2), and write(2). The st_mtime is not changed for changes in owner, group, hard link count, or mode.''

Returns
Time of the last modification in seconds since the epoch.
See also
get_das_last_modified_time()
get_dds_last_modified_time() */ time_t DODSFilter::get_dataset_last_modified_time() const { return last_modified_time(d_dataset); }

/** Get the last modified time for the dataset's DAS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DAS' last modified time.

Parameters
anc_locationA directory to search for ancillary files (in addition to the CWD).
Returns
Time of last modification of the DAS.
See also
get_dataset_last_modified_time()
get_dds_last_modified_time()

Definition at line 450 of file DODSFilter.cc.

◆ get_data_last_modified_time()

time_t libdap::DODSFilter::get_data_last_modified_time ( const string & anc_location = "") const
virtual

Get the last modified time to be used for a particular data request. This method should look at both the constraint expression and any ancillary files for this dataset. The implementation provided here returns the latest time returned by the get_dataset...(), get_das...() and get_dds...() methods and does not currently check the CE.

Parameters
anc_locationA directory to search for ancillary files (in addition to the CWD).
Returns
Time of last modification of the data.
See also
get_dataset_last_modified_time()
get_das_last_modified_time()
get_dds_last_modified_time()

Definition at line 490 of file DODSFilter.cc.

◆ get_dataset_version()

string libdap::DODSFilter::get_dataset_version ( ) const
virtual

Get the version information for the dataset.

To read version information that is specific to a certain dataset, override this method with an implementation that does what you want. By default, this returns an empty string.

Returns
A string object that contains the dataset version information.

Definition at line 382 of file DODSFilter.cc.

◆ get_dds_last_modified_time()

time_t libdap::DODSFilter::get_dds_last_modified_time ( const string & anc_location = "") const
virtual

Get the last modified time for the dataset's DDS. This time, given in seconds since the epoch (1 Jan 1970 00:00:00 GMT), is the greater of the datasets's and any ancillary DDS' last modified time.

Returns
Time of last modification of the DDS.
See also
get_dataset_last_modified_time()
get_dds_last_modified_time()

Definition at line 467 of file DODSFilter.cc.

◆ get_description_type()

ObjectType libdap::get_description_type ( const string & value)

This function returns the ObjectType value that matches the given string. Modified to include tests for the descriptions that use hyphens in addition to underscores. 8/1/08 jhrg

Parameters
valueValue from the HTTP response header

Definition at line 309 of file mime_util.cc.

◆ get_dims_decl()

string libdap::get_dims_decl ( Array & a)

Makes the square bracket representation, with dimension names where available, of the array's dimensions, ex: [5][lat=100][lon=200]

Parameters
aThe array to examine
Returns
The square bracket representation of the array's dimensions

Definition at line 1334 of file Array.cc.

◆ get_hash()

int libdap::get_hash ( const string & url)

Compute the hash value for a URL.

Parameters
url
Returns
An integer hash code between 0 and CACHE_TABLE_SIZE.

Definition at line 98 of file HTTPCacheTable.cc.

◆ get_next_mime_header() [1/2]

std::string libdap::get_next_mime_header ( FILE * in)

Read the next MIME header from the input stream and return it in a string object. This function consumes any leading whitespace before the next header. It returns an empty string when the blank line that separates the headers from the body is found. This function works for header and separator lines that use either a CRLF pair (the correct line ending) or just a newline (a common error).

Deprecated
Note
FIXME: This function returns tainted data.
Parameters
inRead from this stream (FILE *)
Returns
A string that contains the next header line or is empty indicating the separator has been read.
Exceptions
Erroris thrown if no header or separator is found.
See also
parse_mime_header()

Definition at line 777 of file mime_util.cc.

◆ get_next_mime_header() [2/2]

std::string libdap::get_next_mime_header ( istream & in)

This function and its companion read the next MIME header from an input stream (or FILE*) and return it as a string. The stream pointer is updated to the next line of input. It returns an empty string when the blank line ending the MIME headers is found.

Note
FIXME: This function returns tainted data.
Parameters
inRead the next header from the input stream
Returns
Return the next header in a string; an empty string indicates all headers have been returned.

Definition at line 808 of file mime_util.cc.

◆ get_request_if_modified_since()

time_t libdap::DODSFilter::get_request_if_modified_since ( ) const
virtual

Get the value of a conditional request's If-Modified-Since header. This value is used to determine if the request should get a full response or a Not Modified (304) response. The time is given in seconds since the Unix epoch (midnight, 1 Jan 1970). If no time was given with the request, this methods returns -1.

Returns
If-Modified-Since time from a condition GET request.

Definition at line 514 of file DODSFilter.cc.

◆ get_response()

DODSFilter::Response libdap::DODSFilter::get_response ( ) const
virtual

Get the enum name of the response to be returned.

Definition at line 414 of file DODSFilter.cc.

◆ get_str()

vector< string > & libdap::get_str ( )

Provide access to internal string data by reference. Callers cannot delete this but can pass them to other methods.

Returns
A reference to a vector of strings

Definition at line 152 of file Vector.h.

◆ get_temp_file()

string libdap::get_temp_file ( FILE *& stream)

Open a temporary file and return its name. This method opens a temporary file using get_tempfile_template(). The FILE* stream is opened for both reads and writes; if it already exists (highly unlikely), it is truncated. If used on Unix, it's the callers responsibility to unlink the named file so that when all descriptors to it are closed, it will be deleted. On Win32 platforms, this method pushes the name of the temporary file onto a vector which is used during object destruction to delete all the temporary files.

Note
Delete the returned char* using delete[].

A private method.

Parameters
streamA value-result parameter; the open file descriptor is returned via this parameter.
Returns
The name of the temporary file.
Exceptions
InternalErrthrown if the FILE* could not be opened.

Definition at line 723 of file HTTPConnect.cc.

◆ get_type() [1/2]

Type libdap::get_type ( const char * name)

Get the Type enumeration value which matches the given name.

Definition at line 570 of file util.cc.

◆ get_type() [2/2]

ObjectType libdap::get_type ( const string & value)

This function returns the ObjectType value that matches the given string. Modified to include tests for the descriptions that use hyphens in addition to underscores. 8/1/08 jhrg

Deprecated

Definition at line 300 of file mime_util.cc.

◆ get_URL()

string libdap::DODSFilter::get_URL ( ) const
virtual

Get the dataset name.

The ``dataset name'' is the filename or other string that the filter program will use to access the data. In some cases this will indicate a disk file containing the data. In others, it may represent a database query or some other exotic data access method.

Returns
A string object that contains the name of the dataset. */ string DODSFilter::get_dataset_name() const { return d_dataset; }

void DODSFilter::set_dataset_name(const string ds) { d_dataset = www2id(ds, "%", "%20"); }

/** Get the URL. This returns the URL, minus the constraint originally sent to the server.

Returns
The URL.

Definition at line 364 of file DODSFilter.cc.

◆ get_value_capacity()

unsigned int Vector::get_value_capacity ( ) const
virtual

Return the capacity of the Vector in terms of number of elements of its data type that it can currently hold (i.e. not bytes). For example, this could be the size of the _buf array in bytes / sizeof(T) for the cardinal types T, or the capacity of the d_str vector if T is string or url type.

Definition at line 1663 of file Vector.cc.

◆ get_value_capacity_ll()

uint64_t Vector::get_value_capacity_ll ( ) const
virtual

Definition at line 1665 of file Vector.cc.

◆ glob()

int libdap::glob ( const char * c,
const char * s )

glob: match a string against a simple pattern

Understands the following patterns:

  • any number of characters ? any single character [a-z] any single character in the range a-z [^a-z] any single character not in the range a-z \x match x
Parameters
cThe pattern
sThe string
Returns
0 on success, -1 if the pattern is exhausted but there are characters remaining in the string and 1 if the pattern does not match

Definition at line 1049 of file util.cc.

◆ has_dap2_attributes() [1/2]

bool libdap::has_dap2_attributes ( AttrTable & a)

Does this AttrTable have descendants that are scalar or vector attributes?

Parameters
aThe AttrTable
Returns
true if the table contains a scalar- or vector-valued attribute, otherwise false.

Definition at line 838 of file DDS.cc.

◆ has_dap2_attributes() [2/2]

bool libdap::has_dap2_attributes ( BaseType * btp)

Does this variable, or any of its descendants, have attributes?

Parameters
btpThe variable
Returns
True if any of the variable's descendants have attributes, otherwise false.

Definition at line 857 of file DDS.cc.

◆ hexstring()

string libdap::hexstring ( unsigned char val)

Definition at line 81 of file escaping.cc.

◆ id2www()

string libdap::id2www ( string in,
const string & allowable )

Replace characters that are not allowed in DAP2 identifiers.

-In the DAP itself, id2www() is called in:

  1. Array::print_decl() where dimension names are escaped
  2. AttrTable::print() (which calls AttrTable::simple_print()) where attribute names are escaped
  3. BaseType::print_decl() where variable names are escaped.
  4. Constructor::print_decl() where the name of the constructor type is printed.
  5. DDS::print() and DDS::print_constrained() where the name of the dataset is printed.
  6. Grid::print_decl() where the name of the grid is printed.

-In the client code:

  1. id2www_ce() is called five times in the five methods that are used to request responses where a CE is appended to a URL (Connect::request_version, request_protocol, request_das, request_dds, request_data).
Parameters
inReplace characters in this string.
allowableThe set of characters that are allowed in a URI. default: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+_/.\\*"
See also
id2www_ce()
Returns
The modified identifier.

Definition at line 143 of file escaping.cc.

◆ id2www_ce()

string libdap::id2www_ce ( string in,
const string & allowable )

Replace characters that are not allowed in WWW URLs using rules specific to Constraint Expressions. This has changed over time and now the only difference is that '*' is escaped by this function while it is not escaped by id2www().

Parameters
inThe string in which to replace characters.
allowableThe set of characters that are allowed in a URI. default: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+_/.\\"
See also
id2www()
Returns
The modified identifier.

Definition at line 166 of file escaping.cc.

◆ id2xml()

string libdap::id2xml ( string in,
const string & not_allowed )

Replace characters that are not allowed in XML

Parameters
inThe string in which to replace characters.
not_allowedThe set of characters that are not allowed in XML. default: ><&'(single quote)"(double quote)
Returns
The modified identifier.

Definition at line 253 of file escaping.cc.

◆ initialize() [1/2]

void libdap::DODSFilter::initialize ( )
protected

Called when initializing a DODSFilter that's not going to be passed a command line arguments.

Definition at line 188 of file DODSFilter.cc.

◆ initialize() [2/2]

void libdap::DODSFilter::initialize ( int argc,
char * argv[] )
protected

Initialize. Specializations can call this once an empty DODSFilter has been created using the default constructor. Using a method such as this provides a way to specialize the process_options() method and then have that specialization called by the subclass' constructor.

This class and any class that specializes it should call this method in its constructor. Note that when this method is called, the object is not fully constructed.

Parameters
argcThe argument count
argvThe vector of char * argument strings.

Definition at line 228 of file DODSFilter.cc.

◆ intern_data()

void libdap::intern_data ( ConstraintEvaluator & eval,
DDS & dds )
overridevirtual

Similar to using serialize() and deserialize() together in one object. Data are read as for serialize and those values are stored in the objects as deserialize() does but does not write and then read data to/from a stream.

This method is defined by the various data type classes. It calls the read() abstract method. Unlike serialize(), this method does not clear the memory use to hold the data values, so the caller should make sure to delete the DDS or the variable as soon as possible.

Note
This version of the method is specific to DAP2. It will throw an exception if called on a variable where the is_dap4 property is true.
Parameters
evalUse this as the constraint expression evaluator.
ddsThe Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure.

Definition at line 200 of file D4Sequence.h.

◆ is_boundary()

bool libdap::is_boundary ( const char * line,
const string & boundary )

Is this string the same as the MPM boundary value?

Note
Since fgets() is used to read into line, it is guaranteed to be null terminated.
Parameters
lineThe input to test
boundaryThe complete boundary line to test for, excluding terminating characters.
Returns
true is line is a MPM boundary

Definition at line 876 of file mime_util.cc.

◆ is_conditional()

bool libdap::DODSFilter::is_conditional ( ) const
virtual

Is this request conditional?

Returns
True if the request is conditional.
See also
get_request_if_modified_since().

Definition at line 315 of file DODSFilter.cc.

◆ is_constructor_type() [1/2]

bool BaseType::is_constructor_type ( ) const
virtual

Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.

Returns
True if the instance is a Structure, Sequence or Grid, False otherwise.

Definition at line 358 of file BaseType.cc.

◆ is_constructor_type() [2/2]

bool libdap::is_constructor_type ( Type t)

Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable.

Returns
True if the instance is a Structure, Sequence or Grid, False otherwise.

Definition at line 848 of file util.cc.

◆ is_dap4()

virtual bool libdap::is_dap4 ( ) const
virtual

Definition at line 181 of file BaseType.h.

◆ is_hop_by_hop_header()

bool libdap::is_hop_by_hop_header ( const string & header)

Is the header a hop by hop header? If so, we're not supposed to store it in the cache. See RFC 2616, Section 13.5.1.

Returns
True if the header is, otherwise False.

Definition at line 850 of file HTTPCache.cc.

◆ is_host_big_endian()

bool libdap::is_host_big_endian ( )

Does this host use big-endian byte order?

Definition at line 94 of file util.cc.

◆ is_in_selection()

bool BaseType::is_in_selection ( )
virtual

Is this variable part of the current selection?

Does this variable appear in either the selection part or as a function argument in the current constrain expression. If this property is set (true) then implementations of the read() method should read this variable.

Note
This method does not check, nor does it know about the semantics of, string arguments passed to functions. Those functions might include variable names in strings; they are responsible for reading those variables. See the grid (func_grid_select()) for an example.
See also
BaseType::read()

Definition at line 600 of file BaseType.cc.

◆ is_integer_type()

bool libdap::is_integer_type ( Type t)

Is this an integer type?

Returns
True if the type holds an integer value, false otherwise.

Definition at line 888 of file util.cc.

◆ is_keyword()

bool libdap::is_keyword ( string id,
const string & keyword )

Definition at line 161 of file parser-util.cc.

◆ is_quoted()

bool libdap::is_quoted ( const string & s)

Is the string surrounded by double quotes?

Parameters
sThe source string @reurn True if the string is quoted, false otherwise.

Definition at line 554 of file util.cc.

◆ is_simple_type() [1/2]

bool BaseType::is_simple_type ( ) const
virtual

Returns true if the instance is a numeric, string or URL type variable.

Returns
True if the instance is a scalar numeric, String or URL variable, False otherwise. Arrays (even of simple types) return False.
See also
is_vector_type()

Definition at line 347 of file BaseType.cc.

◆ is_simple_type() [2/2]

bool libdap::is_simple_type ( Type t)

Returns true if the instance is a numeric, string or URL type variable.

Returns
True if the instance is a scalar numeric, String or URL variable, False otherwise. Arrays (even of simple types) return False.
See also
is_vector_type()

Definition at line 766 of file util.cc.

◆ is_vector_type() [1/2]

bool BaseType::is_vector_type ( ) const
virtual

Returns true if the instance is a vector (i.e., array) type variable.

Returns
True if the instance is an Array, False otherwise.

Definition at line 352 of file BaseType.cc.

◆ is_vector_type() [2/2]

bool libdap::is_vector_type ( Type t)

Returns true if the instance is a vector (i.e., array) type variable.

Returns
True if the instance is an Array, False otherwise.

Definition at line 805 of file util.cc.

◆ last_modified_time()

time_t libdap::last_modified_time ( const string & name)

Get the last modified time. Assume name is a file and find its last modified time. If name is not a file, then return now as the last modified time.

Parameters
nameThe name of a file.
Returns
The last modified time or the current time.

Definition at line 94 of file mime_util.cc.

◆ length()

int libdap::length ( ) const
overridevirtual

How many elements are in this variable? Uses -1 in places.

Returns the number of elements in the vector. Note that some child classes of Vector use the length of -1 as a flag value.

Holds a sequence. */.

Returns
The number of elements; 1 for scalars
Deprecated
Use length_ll() instead

This is the interface for the class D4Sequence. A sequence contains a single set of variables, all at the same lexical level just like a Structure. Like a Structure, a D4Sequence may contain other compound types, including other D4Sequences. Unlike a Structure, a D4Sequence defines a pattern that is repeated N times for a sequence of N elements. It is useful to think of a D4Sequence as representing a table of values (like a relational database), with each row of the table corresponding to a D4Sequence instance.'' (This usage can be confusing, since instance'' also refers to a particular item of class D4Sequence.) For example:

    D4Sequence {
      String name;
      Int32 age;
    } person;
    

This represents a Sequence of ``person'' records, each instance of which contains a name and an age:

    Fred       34
    Ralph      23
    Andrea     29
    ...
    

A D4Sequence can be arbitrarily long, which is to say that its length is not part of its declaration. A D4Sequence can contain other D4Sequences:

    D4Sequence {
      String name;
      Int32 age;
      D4Sequence {
        String friend;
      } friend_list;
    } person;
    
    Fred       34     Norman
                      Andrea
                      Ralph
                      Lisa
    Ralph      23     Norman
                      Andrea
                      Lisa
                      Marth
                      Throckmorton
                      Helga
                      Millicent
    Andrea     29     Ralph
                      Natasha
                      Norman
    ...        ..     ...
    

Internally, the D4Sequence is represented by a vector of vectors. The members of the outer vector are the members of the D4Sequence. This includes the nested D4Sequences, as in the above example.

Because the length of a D4Sequence is indeterminate, there are changes to the behavior of the functions to read this class of data. The read() function for D4Sequence must be written so that successive calls return values for successive rows of the D4Sequence.

Similar to a C structure, you refer to members of D4Sequence elements with a .'' notation. For example, if the D4Sequence has a member D4Sequence called Tom'' and Tom has a member Float32 called shoe_size'', you can refer to Tom's shoe size as Tom.shoe_size''.

class D4Sequence : public Constructor { private: This may be zero (nullptr) but the accessor (clauses()) allocates an instance if that is the case. D4FilterClauseList *d_clauses;

Use this to control if ptr_duplicate(), ..., copy the filter clauses. Because the values of a child sequence are held in copies of the Seq object they clauses will be bound to the 'master' instance will be copied but the copies will never be used. This field can be used to control that. ...purely an optimization. bool d_copy_clauses;

protected: This holds the values of the sequence. Values are stored in instances of BaseTypeRow objects which hold instances of BaseType.

Allow these values to be accessed by subclasses D4SeqValues d_values;

int64_t d_length; // How many elements are in the sequence; -1 if not currently known

void m_duplicate(const D4Sequence &s);

Specialize this if you have a data source that requires read() recursively call itself for child sequences. void read_sequence_values(bool filter);

friend class D4SequenceTest;

public: D4Sequence(const string &n); D4Sequence(const string &n, const string &d);

D4Sequence(const D4Sequence &rhs);

virtual ~D4Sequence();

D4Sequence &operator=(const D4Sequence &rhs);

BaseType *ptr_duplicate() override;

void clear_local_data() override;

/**

The number of elements in a Sequence object.

Note
This is not the number of items in a row, but the number of rows in the complete sequence object.
Returns
0 if the number of elements is unknown, else return the number of elements.
The number of elements in the vector
Deprecated
Use length_ll() instead

Definition at line 207 of file BaseType.h.

◆ length_ll()

int64_t libdap::length_ll ( ) const
overridevirtual

Get the number of elements in this variable This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that a Vector/Array holds no values yet (as opposed to zero values). For types not derived from Vector, there is always one element.

Get the number of elements in this Vector/Array This version of the function deprecates length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values yet (as opposed to zero values).

Returns
The number of elements in this variable
The number of elements in this Vector/Array

Definition at line 216 of file BaseType.h.

◆ libdap_name()

const char * libdap::libdap_name ( )

Definition at line 517 of file util.cc.

◆ libdap_root()

const char * libdap::libdap_root ( )

Definition at line 505 of file util.cc.

◆ libdap_version()

const char * libdap::libdap_version ( )

Return the version string for this package.

Note
This function has C linkage so that it can be found using autoconf tests.
Returns
The version string.

Definition at line 511 of file util.cc.

◆ long_to_string()

string libdap::long_to_string ( long val,
int base )

Definition at line 946 of file util.cc.

◆ make_rvalue_list()

rvalue_list * libdap::make_rvalue_list ( rvalue * rv)

Definition at line 53 of file RValue.cc.

◆ munge_error_message()

string libdap::munge_error_message ( string msg)

Definition at line 446 of file escaping.cc.

◆ name_path()

std::string libdap::name_path ( const string & path)

Returns the filename portion of a pathname.

Given a pathname, this function returns just the file name component of the path. That is, given /a/b/c/ralph.nc.das, it returns ralph.nc.

Parameters
pathA C-style simple string containing a pathname to be parsed.
Returns
A C-style simple string containing the filename component of the given pathname.

Definition at line 250 of file mime_util.cc.

◆ octal_to_hex()

string libdap::octal_to_hex ( const string & octal_digits)

Definition at line 236 of file escaping.cc.

◆ octstring()

string libdap::octstring ( unsigned char val)

Definition at line 98 of file escaping.cc.

◆ open_temp_fstream()

string libdap::open_temp_fstream ( ofstream & f,
const string & name_template,
const string & suffix )

Using the given template, open a temporary file using the given ofstream object. Uses mkstemp() in a 'safe' way.

Parameters
fValue-result parameter
name_templateThe template used to name the temporary file. The template has the form templateXXXXXX where the six Xs will be overwritten.
suffixIf present, the template is 'templateXXXXXX.suffix'
Returns
The new file's name.
Exceptions
Errorif there is a problem.

Definition at line 1214 of file util.cc.

◆ parse_error() [1/3]

void libdap::parse_error ( const char * msg,
const int line_num,
const char * context )

Definition at line 115 of file parser-util.cc.

◆ parse_error() [2/3]

void libdap::parse_error ( const string & msg,
const int line_num,
const char * context )

Definition at line 140 of file parser-util.cc.

◆ parse_error() [3/3]

void libdap::parse_error ( parser_arg * arg,
const char * msg,
const int line_num,
const char * context )

Definition at line 89 of file parser-util.cc.

◆ parse_mime_header()

void libdap::parse_mime_header ( const string & header,
string & name,
string & value )

Given a string that contains a MIME header line, parse it into the the header (name) and its value. Both are downcased.

Parameters
headerThe input line, striped of the ending crlf pair
nameA value-result parameter that holds the header name
valueA value-result parameter that holds the header's value.

Definition at line 848 of file mime_util.cc.

◆ parse_time()

time_t libdap::parse_time ( const char * str,
bool expand )

Parse a string in GMT format to a local time time_t representation Four formats are accepted: Wkd, 00 Mon 0000 00:00:00 GMT (rfc1123) Weekday, 00-Mon-00 00:00:00 GMT (rfc850) Wkd Mon 00 00:00:00 0000 GMT (ctime) 1*DIGIT (delta-seconds)

Copied from libwww. 09/19/02 jhrg

Parameters
strThe time string.
expandIf the time is given in delta seconds, adjust it to seconds since midnight 1 Jan 1970 if this is true. If false, simply convert the string to a time_t and return. The default value is true.
Returns
The time in seconds since midnight 1 Jan 1970. Return 0 if an error is detected.

Definition at line 144 of file util_mit.cc.

◆ path_to_filename()

string libdap::path_to_filename ( string path)

Get the filename part from a path. This function can be used to return a string that has the directory components stripped from a path. This is useful when building error message strings.

If WIN32 is defined, use '\' as the path separator, otherwise use '/' as the path separator.

Returns
A string containing only the filename given a path.

Definition at line 988 of file util.cc.

◆ pathname_ok()

bool libdap::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 valid name. We define this as: Contains only printable characters; and Is less then 256 characters. If strict is true, test that the pathname consists of only letters, digits, and underscore, dash and dot characters instead of the more general case where a pathname can be composed of any printable characters.

Note
Using this function does not guarantee that the path is valid, only that the path could be valid. The intent is foil attacks where an exploit is encoded in a string then passed to a library function. This code does not address whether the pathname references a valid resource.
Parameters
pathThe pathname to test
strictApply more restrictive tests (true by default)
Returns
true if the pathname consists of legal characters and is of legal size, false otherwise.

Definition at line 1156 of file util.cc.

◆ print_one_row()

void libdap::Sequence::print_one_row ( ostream & out,
int row,
string space,
bool print_row_num = false )
virtual

Definition at line 394 of file D4Sequence.cc.

◆ print_usage()

void libdap::DODSFilter::print_usage ( ) const
virtual

Print usage information for a filter program.

This message is printed when the filter program is incorrectly invoked by the dispatch CGI. This is an error in the server installation or the CGI implementation, so the error message is written to stderr instead of stdout. A server's stderr messages show up in the httpd log file. In addition, an error object is sent back to the client program telling them that the server is broken.

Definition at line 578 of file DODSFilter.cc.

◆ print_val() [1/2]

virtual void libdap::print_val ( FILE * out,
string space = "",
bool print_decl_p = true )
virtual

Prints the value of the variable.

Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS applications. However, it can be overloaded and used to do some useful things. Take a look at the asciival and writeval clients, both of which overload this to output the values of variables in different ways.

Parameters
outThe output stream on which to print the value.
spaceThis value is passed to the print_decl() function, and controls the leading spaces of the output.
print_decl_pA boolean value controlling whether the variable declaration is printed as well as the value.

◆ print_val() [2/2]

void libdap::print_val ( ostream & out,
string space = "",
bool print_decl_p = true )
overridepure virtual

Prints the value of the variable.

Prints the value of the variable, with its declaration. This function is primarily intended for debugging DODS applications. However, it can be overloaded and used to do some useful things. Take a look at the asciival and writeval clients, both of which overload this to output the values of variables in different ways.

Parameters
outThe output ostream on which to print the value.
spaceThis value is passed to the print_decl() function, and controls the leading spaces of the output.
print_decl_pA boolean value controlling whether the variable declaration is printed as well as the value.

◆ print_val_by_rows()

void libdap::Sequence::print_val_by_rows ( ostream & out,
string space = "",
bool print_decl_p = true,
bool print_row_numbers = true )
virtual

Definition at line 436 of file D4Sequence.cc.

◆ print_var_das()

void libdap::print_var_das ( ostream & out,
BaseType * bt,
string indent = "" )

Definition at line 887 of file DDS.cc.

◆ process_options()

int libdap::DODSFilter::process_options ( int argc,
char * argv[] )
protectedvirtual

Processing the command line options passed to the filter is handled by this method so that specializations can change the options easily.

Parameters
argcThe argument count
argvThe vector of char * argument strings.
Returns
The index of the next, unprocessed, argument. This must be the identifier passed to the filter program that identifies the data source. It's often a file name.

Definition at line 254 of file DODSFilter.cc.

◆ prototype()

virtual BaseType * libdap::prototype ( ) const
virtual

Definition at line 163 of file Vector.h.

◆ prune_spaces()

string libdap::prune_spaces ( const string & name)

Removed spaces from the front of a URL and also from the front of the CE. This function assumes that there are no holes in both the URL and the CE. It will remove leading space, but not other spaces.

Parameters
nameThe URL to process
Returns
Returns a new string object that contains the pruned URL.

Definition at line 451 of file util.cc.

◆ ptr_duplicate()

virtual BaseType * libdap::ptr_duplicate ( )
pure virtual

Clone this instance. Allocate a new instance and copy *this into it. This method must perform a deep copy.

@note This method should \e not copy data values, but must copy all
other fields in the object.
Returns
A newly allocated copy of this.

◆ read_multipart_boundary() [1/2]

std::string libdap::read_multipart_boundary ( FILE * in,
const string & boundary )

Read the next line of input and test to see if it is a multipart MIME boundary line. If the value of boundary is the default (an empty string) then just test that the line starts with "--". In either case, return the value of boundary just read.

Parameters
boundaryValue of the boundary to look for - optional
inRead from this FILE*
Returns
The value of the boundary header read
Exceptions
Errorif no boundary was found.

Definition at line 893 of file mime_util.cc.

◆ read_multipart_boundary() [2/2]

std::string libdap::read_multipart_boundary ( istream & in,
const string & boundary )

Definition at line 904 of file mime_util.cc.

◆ read_multipart_headers() [1/2]

void libdap::read_multipart_headers ( FILE * in,
const string & content_type,
const ObjectType object_type,
const string & cid )

Consume the Multipart MIME headers that prefix the DDX in a DataDDX response. The stream pointer is advanced to the start of the DDX. It might seem odd that this function both takes the value of the MPM boundary as a parameter and returns that value as a result, but this code can be used in two different situations. In one case, it is called on a partial document read from stdin and needs to return the value of boundary to the downstream DDX parser so that code can sense the end of the DDX. In the other case, this function is told the value of boundary and tests for it to ensure document correctness.

Parameters
inRead from this stream
content_typeThe expected value of the Content-Type header
object_typeThe expected value of the Content-Description header
cidThe expected value of the Content-Id header - optional.
Returns
The value of the MIME boundary
Exceptions
Errorif the boundary is not found or if any of the expected header values don't match. The optional values are tested only if they are given (the default values are not tested).

Definition at line 935 of file mime_util.cc.

◆ read_multipart_headers() [2/2]

void libdap::read_multipart_headers ( istream & in,
const string & content_type,
const ObjectType object_type,
const string & cid )

Definition at line 969 of file mime_util.cc.

◆ read_next_instance()

bool libdap::D4Sequence::read_next_instance ( bool filter)
virtual

Read the next instance of the sequence While the rest of the variables' read() methods are assumed to return the entire variable in one call (modulo enhancements of the library to support streaming large variables), this class assumes that the underlying data store is returning data from a table of unknown size. Thus, D4Sequence::read() is assumed to return one instance (or element or row) of the sequence per call and return true when the EOF (end of the sequence) is reached.

For each call to read, the values for each of the sequence's members are expected to have been loaded into the member's BaseType variables; this method will copy them out and store then in the D4Sequence's internal storage. This method always returns the next instance that satisfies the CE when 'filter' is true.

Note
This method is called by D4Sequence::serialize() and it will evaluate the CE for each set of values read.
Parameters
dmr
eval
filter
Returns
False when read() indicates that the EOF was found, true otherwise.

Definition at line 169 of file D4Sequence.cc.

◆ read_p()

bool BaseType::read_p ( )
virtual

Has this variable been read?

Returns true if the value(s) for this variable have been read from the data source, otherwise returns false. This method is used to determine when values need to be read using the read() method. When read_p() returns true, this library assumes that buf2val() (and other methods such as get_vec()) can be used to access the value(s) of a variable.

Returns
True if the variable's value(s) have been read, false otherwise.

Definition at line 410 of file BaseType.cc.

◆ remove_mime_header()

void libdap::remove_mime_header ( istream & in)

Send a `Not Modified' response.

Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in the request. This will have to be a date until the servers support ETags.

Deprecated
Parameters
outWrite the response to this FILE pointer. */ void set_mime_not_modified(FILE *out) { ostringstream oss; set_mime_not_modified(oss); fwrite(oss.str().data(), 1, oss.str().length(), out); }

/** Use this function to create a response signaling that the target of a conditional get has not been modified relative to the condition given in the request. This will have to be a date until the servers support ETags.

Deprecated

Send a `Not Modified' response.

Parameters
strmWrite the response to this stream. */ void set_mime_not_modified(ostream &strm) { strm << "HTTP/1.0 304 NOT MODIFIED" << CRLF; const time_t t = time(0); strm << "Date: " << rfc822_date(t).c_str() << CRLF; strm << CRLF; }

/** Read the input stream in and discard the MIME header. The MIME header is separated from the body of the document by a single blank line. If no MIME header is found, then the input stream is `emptied' and will contain nothing.

Deprecated

Read and discard the MIME header of the stream in.

Returns
True if a MIME header is found, false otherwise. */ bool remove_mime_header(FILE *in) { char tmp[256]; while (!feof(in)) { char *s = fgets(tmp, 255, in); if (s && strncmp(s, CRLF, 2) == 0) return true; }

return false; }

/** Used for test code; strip the leading MIME headers from a response.

Parameters
in

Definition at line 1145 of file mime_util.cc.

◆ remove_quotes()

string libdap::remove_quotes ( const string & s)

Return a new string that is not quoted. This will return a new string regardless of whether the source string is actualy quoted.

Parameters
sThe source string
Returns
A new string without quotes

Definition at line 562 of file util.cc.

◆ remove_space_encoding()

string libdap::remove_space_encoding ( const string & s)

Remove %20 space encoding

Definition at line 61 of file AttrTable.cc.

◆ reserve_value_capacity() [1/2]

void Vector::reserve_value_capacity ( )
virtual

Make sure there's storage allocated for the current length() of the Vector. Same as reserveValueCapacity(length())

Definition at line 1735 of file Vector.cc.

◆ reserve_value_capacity() [2/2]

void Vector::reserve_value_capacity ( unsigned int numElements)
virtual

Allocate enough memory for the Vector to contain numElements data elements of the Vector's type. Must be used before set_value_slice_from_row_major_vector to ensure memory exists.

Parameters
numElementsthe number of elements of the Vector's type to preallocate storage for.
Exceptions
ifthe memory cannot be allocated

Definition at line 1675 of file Vector.cc.

◆ reserve_value_capacity_ll() [1/2]

void Vector::reserve_value_capacity_ll ( )
virtual

Make sure there's storage allocated for the current length() of the Vector. Same as reserveValueCapacity(length())

Definition at line 1808 of file Vector.cc.

◆ reserve_value_capacity_ll() [2/2]

void Vector::reserve_value_capacity_ll ( uint64_t numElements)
virtual

Allocate enough memory for the Vector to contain numElements data elements of the Vector's type. Must be used before set_value_slice_from_row_major_vector to ensure memory exists.

Parameters
numElementsthe number of elements of the Vector's type to preallocate storage for.
Exceptions
ifthe memory cannot be allocated

Definition at line 1748 of file Vector.cc.

◆ reserve_value_capacity_ll_byte()

void Vector::reserve_value_capacity_ll_byte ( uint64_t numBytes)
virtual

A light-weight method to allocate the storage size in bytes of the Vector. This method is necessary for operations like direct IO in the BES.

Definition at line 1818 of file Vector.cc.

◆ rfc822_date()

std::string libdap::rfc822_date ( const time_t t)

Given a constant pointer to a time_t, return a RFC 822/1123 style date.

This function returns the RFC 822 date with the exception that the RFC 1123 modification for four-digit years is implemented.

Returns
The RFC 822/1123 style date in a C++ string.
Parameters
tA const time_t pointer.

Definition at line 148 of file mime_util.cc.

◆ row_value()

BaseTypeRow * libdap::Sequence::row_value ( size_t row)
virtual

Get a whole row from the sequence.

Parameters
rowGet row number row from the sequence.
Returns
A BaseTypeRow object (vector<BaseType *>). Null if there's no such row number as row.

Definition at line 357 of file D4Sequence.cc.

◆ save_str()

void libdap::save_str ( std::string & dst,
const char * src,
const int  )

Save a string to a temporary variable during the parse.

Given a string (const char *src), save it to the temporary variable pointed to by dst. If the string is longer than ID_MAX, generate and error indicating that src was truncated to ID_MAX characters during the copy operation. There are two versions of this function; one calls the version of parser_error() which writes to stderr. The version which accepts the parser_arg *arg argument calls the version of parser_error() which generates and Error object.

Returns
void

Definition at line 159 of file parser-util.cc.

◆ send_das() [1/3]

void libdap::DODSFilter::send_das ( DAS & das,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Definition at line 632 of file DODSFilter.cc.

◆ send_das() [2/3]

void libdap::DODSFilter::send_das ( FILE * out,
DAS & das,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Transmit a DAS.

This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program.

Parameters
outThe output FILE to which the DAS is to be sent.
dasThe DAS object to be sent.
anc_locationThe directory in which the external DAS file resides.
with_mime_headersIf true (the default) send MIME headers.
Returns
void
See also
DAS

Definition at line 603 of file DODSFilter.cc.

◆ send_das() [3/3]

void libdap::DODSFilter::send_das ( ostream & out,
DAS & das,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Transmit a DAS.

This function formats and prints an ASCII representation of a DAS on stdout. This has the effect of sending the DAS object back to the client program.

Parameters
outThe output stream to which the DAS is to be sent.
dasThe DAS object to be sent.
anc_locationThe directory in which the external DAS file resides.
with_mime_headersIf true (the default) send MIME headers.
Returns
void
See also
DAS

Definition at line 620 of file DODSFilter.cc.

◆ send_data() [1/2]

void libdap::DODSFilter::send_data ( DDS & dds,
ConstraintEvaluator & eval,
FILE * data_stream,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Transmit a DDS.

This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client program. Either an entire DDS or a constrained DDS may be sent.

Parameters
outThe output FILE to which the DAS is to be sent.
ddsThe DDS to send back to a client.
evalA reference to the ConstraintEvaluator to use.
constrainedIf this argument is true, evaluate the current constraint expression and send the `constrained DDS' back to the client.
anc_locationThe directory in which the external DAS file resides.
with_mime_headersIf true (the default) send MIME headers.
Returns
void
See also
DDS */ void DODSFilter::send_dds(FILE *out, DDS &dds, ConstraintEvaluator &eval, bool constrained, const string &anc_location, bool with_mime_headers) const { ostringstream oss; send_dds(oss, dds, eval, constrained, anc_location, with_mime_headers); fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); }

/** This function formats and prints an ASCII representation of a DDS on stdout. When called by a CGI program, this has the effect of sending a DDS object back to the client program. Either an entire DDS or a constrained DDS may be sent.

Transmit a DDS.

Parameters
outThe output stream to which the DAS is to be sent.
ddsThe DDS to send back to a client.
evalA reference to the ConstraintEvaluator to use.
constrainedIf this argument is true, evaluate the current constraint expression and send the `constrained DDS' back to the client.
anc_locationThe directory in which the external DAS file resides.
with_mime_headersIf true (the default) send MIME headers.
Returns
void
See also
DDS */ void DODSFilter::send_dds(ostream &out, DDS &dds, ConstraintEvaluator &eval, bool constrained, const string &anc_location, bool with_mime_headers) const { If constrained, parse the constraint. Throws Error or InternalErr. if (constrained) eval.parse_constraint(d_dap2ce, dds);

if (eval.functional_expression()) throw Error("Function calls can only be used with data requests. To see the structure of the underlying data " "source, reissue the URL without the function.");

time_t dds_lmt = get_dds_last_modified_time(anc_location); if (is_conditional() && dds_lmt <= get_request_if_modified_since() && with_mime_headers) { set_mime_not_modified(out); } else { if (with_mime_headers) set_mime_text(out, dods_dds, d_cgi_ver, x_plain, dds_lmt); if (constrained) dds.print_constrained(out); else dds.print(out); }

out << flush; }

void DODSFilter::send_dds(DDS &dds, ConstraintEvaluator &eval, bool constrained, const string &anc_location, bool with_mime_headers) const { send_dds(cout, dds, eval, constrained, anc_location, with_mime_headers); }

'lmt' unused. Should it be used to supply a LMT or removed from the method? jhrg 8/9/05 void DODSFilter::functional_constraint(BaseType &var, DDS &dds, ConstraintEvaluator &eval, FILE *out) const { ostringstream oss; functional_constraint(var, dds, eval, oss); fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); }

'lmt' unused. Should it be used to supply a LMT or removed from the method? jhrg 8/9/05 void DODSFilter::functional_constraint(BaseType &var, DDS &dds, ConstraintEvaluator &eval, ostream &out) const { out << "Dataset {\n"; var.print_decl(out, " ", true, false, true); out << "} function_value;\n"; out << "Data:\n";

out << flush;

Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);

try { In the following call to serialize, suppress CE evaluation. var.serialize(eval, dds, m, false); } catch (Error &e) { throw; } }

void DODSFilter::dataset_constraint(DDS &dds, ConstraintEvaluator &eval, FILE *out, bool ce_eval) const { ostringstream oss; dataset_constraint(dds, eval, oss, ce_eval); fwrite(oss.str().data(), sizeof(char), oss.str().length(), out); }

void DODSFilter::dataset_constraint(DDS &dds, ConstraintEvaluator &eval, ostream &out, bool ce_eval) const { send constrained DDS dds.print_constrained(out); out << "Data:\n"; out << flush;

Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);

try { Send all variables in the current projection (send_p()) for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) if ((*i)->send_p()) { DBG(cerr << "Sending " << (*i)->name() << endl); (*i)->serialize(eval, dds, m, ce_eval); } } catch (Error &e) { throw; } }

void DODSFilter::dataset_constraint_ddx(DDS &dds, ConstraintEvaluator &eval, ostream &out, const string &boundary, const string &start, bool ce_eval) const { Write the MPM headers for the DDX (text/xml) part of the response set_mime_ddx_boundary(out, boundary, start, dods_ddx);

Make cid uuid_t uu; uuid_generate(uu); char uuid[37]; uuid_unparse(uu, uuid); char domain[256]; if (getdomainname(domain, 255) != 0 || strlen(domain) == 0) strncpy(domain, "opendap.org", 255);

string cid = string(uuid) + "@" + string(domain);

Send constrained DDX with a data blob reference dds.print_xml_writer(out, true, cid);

Write the MPM headers for the data part of the response. set_mime_data_boundary(out, boundary, cid, dap4_data, binary);

Grab a stream that encodes using XDR. XDRStreamMarshaller m(out);

try { Send all variables in the current projection (send_p()) for (DDS::Vars_iter i = dds.var_begin(); i != dds.var_end(); i++) if ((*i)->send_p()) { DBG(cerr << "Sending " << (*i)->name() << endl); (*i)->serialize(eval, dds, m, ce_eval); } } catch (Error &e) { throw; } }

/** Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.

Transmit data.

Parameters
ddsA DDS object containing the data to be sent.
evalA reference to the ConstraintEvaluator to use.
data_streamWrite the response to this FILE.
anc_locationA directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time().
with_mime_headersIf true, include the MIME headers in the response. Defaults to true.
Returns
void

Definition at line 814 of file DODSFilter.cc.

◆ send_data() [2/2]

void libdap::DODSFilter::send_data ( DDS & dds,
ConstraintEvaluator & eval,
ostream & data_stream,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Transmit data.

Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.

Parameters
ddsA DDS object containing the data to be sent.
evalA reference to the ConstraintEvaluator to use.
data_streamWrite the response to this stream.
anc_locationA directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time().
with_mime_headersIf true, include the MIME headers in the response. Defaults to true.
Returns
void

Definition at line 837 of file DODSFilter.cc.

◆ send_data_ddx()

void libdap::DODSFilter::send_data_ddx ( DDS & dds,
ConstraintEvaluator & eval,
ostream & data_stream,
const string & start,
const string & boundary,
const string & anc_location = "",
bool with_mime_headers = true ) const
virtual

Transmit data.

Send the data in the DDS object back to the client program. The data is encoded using a Marshaller, and enclosed in a MIME document which is all sent to data_stream. If this is being called from a CGI, data_stream is probably stdout and writing to it has the effect of sending the response back to the client.

Parameters
ddsA DDS object containing the data to be sent.
evalA reference to the ConstraintEvaluator to use.
data_streamWrite the response to this stream.
start
boundary
anc_locationA directory to search for ancillary files (in addition to the CWD). This is used in a call to get_data_last_modified_time().
with_mime_headersIf true, include the MIME headers in the response. Defaults to true.
Returns
void

Definition at line 966 of file DODSFilter.cc.

◆ send_ddx() [1/2]

void libdap::DODSFilter::send_ddx ( DDS & dds,
ConstraintEvaluator & eval,
FILE * out,
bool with_mime_headers = true ) const
virtual

Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the servers.

Parameters
ddsThe dataset's DDS with attributes in the variables.
evalA reference to the ConstraintEvaluator to use.
outDestination
with_mime_headersIf true, include the MIME headers in the response. Defaults to true.

Definition at line 906 of file DODSFilter.cc.

◆ send_ddx() [2/2]

void libdap::DODSFilter::send_ddx ( DDS & dds,
ConstraintEvaluator & eval,
ostream & out,
bool with_mime_headers = true ) const
virtual

Send the DDX response. The DDX never contains data, instead it holds a reference to a Blob response which is used to get the data values. The DDS and DAS objects are built using code that already exists in the servers.

Parameters
ddsThe dataset's DDS with attributes in the variables.
evalA reference to the ConstraintEvaluator to use.
outDestination
with_mime_headersIf true, include the MIME headers in the response. Defaults to true.

Definition at line 922 of file DODSFilter.cc.

◆ send_p()

bool BaseType::send_p ( )
virtual

Should this variable be sent?

Returns the state of the send_p property. If true, this variable should be sent to the client, if false, it should not. If no constraint expression (CE) has been evaluated, this property is true for all variables in a data source (i.e., for all the variables listed in a DDS). If a CE has been evaluated, this property is true only for those variables listed in the projection part of the CE.

Returns
True if the variable should be sent to the client, false otherwise.

Definition at line 478 of file BaseType.cc.

◆ send_version_info()

void libdap::DODSFilter::send_version_info ( ) const
virtual

Send version information back to the client program.

This function formats and sends to stdout version information from the httpd server, the server dispatch scripts, the DODS core software, and (optionally) the dataset.

Definition at line 590 of file DODSFilter.cc.

◆ serialize() [1/2]

bool libdap::serialize ( ConstraintEvaluator & eval,
DDS & dds,
Marshaller & m,
bool ce_eval = true )
overridevirtual

Move data to the net, then remove them from the object.

Sends the data from the indicated (local) dataset through the connection identified by the Marshaller parameter. If the data is not already incorporated into the DDS object, read the data from the dataset. Once the data are sent (written to the Marshaller), they are deleted from the object and the object state is reset so that they will be read again if the read() method is called.

This function is only used on the server side of the client/server connection, and is generally only called from the ResponseBuilder functions. It has no BaseType implementation; each datatype child class supplies its own implementation.

Parameters
evalUse this as the constraint expression evaluator.
ddsThe Data Descriptor Structure object corresponding to this dataset. See The DODS User Manual for information about this structure.
mA marshaller used to serialize data types
ce_evalA boolean value indicating whether to evaluate the DODS constraint expression that may accompany this dataset. The constraint expression is stored in the dds.
Returns
This method always returns true. Older versions used the return value to signal success or failure.
Note
We changed the default behavior of this method so that it calls BaseType::clear_local_data() once the values are sent. This, combined with the behavior that read() is called by this method just before data are sent, means that data for any given variable remain in memory for the shortest time possible. Furthermore, since variables are serialized one at a time, no more than one variable's data will be in memory at any given time when using the default behavior. Some code - code that uses intern_data() or server functions - might alter this default behavior. Only Array (i.e. Vector), Sequence, D4Sequence and D4Opaque types actually hold data in dynamically allocated memory, so sonly those types have the new/changed behavior. This change was made on 7/5/15.
Exceptions
InternalErr.
Error.
See also
DDS

Definition at line 203 of file D4Sequence.h.

◆ serialize() [2/2]

void libdap::serialize ( D4StreamMarshaller & m,
DMR & dmr,
bool filter = false )
overridevirtual

The DAP4 serialization method. Serialize a variable's values for DAP4. This does not write the DMR persistent representation but does write that part of the binary data blob that holds a variable's data. Once a variable's data are serialized, that memory is reclaimed (by calling BaseType::clear_local_data()).

Parameters
m
dmr
eval
filterTrue if there is one variable that should be 'filtered'
Exceptions
Erroror InternalErr

◆ set_array_using_double()

void libdap::set_array_using_double ( Array * dest,
double * src,
int src_len )

Given an array that holds some sort of numeric data, load it with values using an array of doubles. This function makes several assumptions. First, it assumes the caller really wants to put the doubles into whatever types the array holds! Caveat emptor. Second, it assumes that if the size of source (src) array is different than the destination (dest) the caller has made a mistake. In that case it will throw an Error object.

After setting the values, this method sets the read_p property for dest. Setting read_p tells the serialization methods in libdap that this variable already holds data values and, given that, the serialization code will not try to read the values.

Note
Support for DAP4 added.
Parameters
destAn Array. The values are written to this array, reusing its storage. Existing values are lost.
srcThe source data.
src_lenThe number of elements in the src array.
Exceptions
ErrorThrown if dest is not a numeric-type array (Byte, ..., Float64) or if the number of elements in src does not match the number is dest.

Definition at line 164 of file util.cc.

◆ set_attr_table()

void BaseType::set_attr_table ( const AttrTable & at)
virtual

Set this variable's attribute table.

Parameters
atSource of the attributes.

Definition at line 502 of file BaseType.cc.

◆ set_attributes()

void BaseType::set_attributes ( D4Attributes * attrs)
virtual

Definition at line 513 of file BaseType.cc.

◆ set_attributes_nocopy()

void BaseType::set_attributes_nocopy ( D4Attributes * attrs)
virtual

Definition at line 515 of file BaseType.cc.

◆ set_ce()

void libdap::DODSFilter::set_ce ( string _ce)
virtual

Definition at line 347 of file DODSFilter.cc.

◆ set_is_dap4()

virtual void libdap::set_is_dap4 ( const bool v)
virtual

Definition at line 182 of file BaseType.h.

◆ set_length()

void libdap::set_length ( int64_t )
overridevirtual

Set the number of elements for this variable. use -1 to indicate nothing set.

Sets the length of the vector. This function does not allocate any new space.

See also
Vector
Parameters
lThe number of elements
Deprecated
Use set_length_ll() instead

Set the length of the sequence.

Parameters
count

This updated version can accept sizes that are too big for a DAP2 Array, but if that happens, a flag is set.

Parameters
lThe number of elements
Deprecated
Use set_length_ll() instead

Definition at line 224 of file BaseType.h.

◆ set_length_ll()

void libdap::set_length_ll ( int64_t )
overridevirtual

Set the number of elements in this variable This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values.

Set the number of elements in this Vector/Array This version of the function deprecates set_length() which is limited to 32-bit sizes. The field uses -1 as a sentinel value indicating that the Vector/Array holds no values.

Parameters
lThe number of elements in the variable
lThe number of elements in the Vector/Array

Definition at line 232 of file BaseType.h.

◆ set_mime_binary() [1/3]

void libdap::set_mime_binary ( FILE * out,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).

Deprecated
Parameters
outWrite the MIME header to this FILE pointer.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 575 of file mime_util.cc.

◆ set_mime_binary() [2/3]

void libdap::set_mime_binary ( ostream & strm,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).

Deprecated
Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 595 of file mime_util.cc.

◆ set_mime_binary() [3/3]

void libdap::set_mime_binary ( ostream & strm,
ObjectType type,
EncodingType enc,
const time_t last_modified,
const string & protocol )

Write an HTTP 1.0 response header for our binary response document (i.e., the DataDDS object).

Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 636 of file mime_util.cc.

◆ set_mime_data_boundary()

void libdap::set_mime_data_boundary ( ostream & strm,
const string & boundary,
const string & cid,
ObjectType type,
EncodingType enc )

Definition at line 748 of file mime_util.cc.

◆ set_mime_ddx_boundary()

void libdap::set_mime_ddx_boundary ( ostream & strm,
const string & boundary,
const string & cid,
ObjectType type,
EncodingType enc )

Definition at line 734 of file mime_util.cc.

◆ set_mime_error() [1/2]

void libdap::set_mime_error ( FILE * out,
int code,
const string & reason,
const string & version )

Generate an HTTP 1.0 response header for an Error object.

Deprecated
Parameters
outWrite the MIME header to this FILE pointer.
codeHTTP 1.0 response code. Should be 400, ... 500, ...
reasonReason string of the HTTP 1.0 response header.
versionThe version string; denotes the DAP spec and implementation version.

Definition at line 1029 of file mime_util.cc.

◆ set_mime_error() [2/2]

void libdap::set_mime_error ( ostream & strm,
int code,
const string & reason,
const string & version )

Generate an HTTP 1.0 response header for an Error object.

Deprecated
Parameters
strmWrite the MIME header to this stream.
codeHTTP 1.0 response code. Should be 400, ... 500, ...
reasonReason string of the HTTP 1.0 response header.
versionThe version string; denotes the DAP spec and implementation version.

Definition at line 1043 of file mime_util.cc.

◆ set_mime_html() [1/3]

void libdap::set_mime_html ( FILE * out,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Generate an HTTP 1.0 response header for a html document.

Deprecated
Parameters
outWrite the MIME header to this FILE pointer.
typeThe type of this this response.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 469 of file mime_util.cc.

◆ set_mime_html() [2/3]

void libdap::set_mime_html ( ostream & strm,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Generate an HTTP 1.0 response header for a html document.

Deprecated
Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 486 of file mime_util.cc.

◆ set_mime_html() [3/3]

void libdap::set_mime_html ( ostream & strm,
ObjectType type,
EncodingType enc,
const time_t last_modified,
const string & protocol )

Generate an HTTP 1.0 response header for a html document.

Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 528 of file mime_util.cc.

◆ set_mime_multipart() [1/2]

void libdap::set_mime_multipart ( ostream & strm,
const string & boundary,
const string & start,
ObjectType type,
const string & version,
EncodingType enc,
const time_t last_modified )

Definition at line 665 of file mime_util.cc.

◆ set_mime_multipart() [2/2]

void libdap::set_mime_multipart ( ostream & strm,
const string & boundary,
const string & start,
ObjectType type,
EncodingType enc,
const time_t last_modified,
const string & protocol,
const string & url )

Build the initial headers for the DAP4 data response

Definition at line 697 of file mime_util.cc.

◆ set_mime_text() [1/3]

void libdap::set_mime_text ( FILE * out,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.

Deprecated
Parameters
outWrite the MIME header to this FILE pointer.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 349 of file mime_util.cc.

◆ set_mime_text() [2/3]

void libdap::set_mime_text ( ostream & strm,
ObjectType type,
const string & ver,
EncodingType enc,
const time_t last_modified )

Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.

Deprecated
Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 368 of file mime_util.cc.

◆ set_mime_text() [3/3]

void libdap::set_mime_text ( ostream & strm,
ObjectType type,
EncodingType enc,
const time_t last_modified,
const string & protocol )

Generate an HTTP 1.0 response header for a text document. This is used when returning a serialized DAS or DDS object.

Note
In Hyrax these headers are not used. Instead the front end of the server will build the response headers
Parameters
strmWrite the MIME header to this stream.
typeThe type of this this response. Defaults to application/octet-stream.
verThe version string; denotes the libdap implementation version.
encHow is this response encoded? Can be plain or deflate or the x_... versions of those. Default is x_plain.
last_modifiedThe time to use for the Last-Modified header value. Default is zero which means use the current time.

Definition at line 420 of file mime_util.cc.

◆ set_prototype()

virtual BaseType * libdap::set_prototype ( BaseType * btp)
virtual

Change the Vector/Array element type.

Parameters
btp
Returns
The previous template, calling code is responsible for the returned BaseType lifecycle.

Definition at line 170 of file Vector.h.

◆ set_response()

void libdap::DODSFilter::set_response ( const string & r)
virtual

Set the response to be returned. Valid response names are "DAS", "DDS", "DataDDS, "Version".

Parameters
rThe name of the object.
Exceptions
InternalErrThrown if the response is not one of the valid names.

Definition at line 390 of file DODSFilter.cc.

◆ set_synthesized_p()

void BaseType::set_synthesized_p ( bool state)
virtual

Returns true if the variable is a synthesized variable. A synthesized variable is one that is added to the dataset by the server (usually with a `projection function'. */ bool BaseType::synthesized_p() { return d_is_synthesized; }

/** Set the synthesized flag. Before setting this flag be sure to set the read_p() state. Once this flag is set you cannot alter the state of the read_p flag!

See also
synthesized_p()

Definition at line 397 of file BaseType.cc.

◆ set_URL()

void libdap::DODSFilter::set_URL ( const string & url)
virtual

Set the URL. Set the URL sent to the server.

Parameters
urlThe URL, minus the constraint.

Definition at line 368 of file DODSFilter.cc.

◆ set_value()

virtual void libdap::set_value ( D4SeqValues & values)
virtual

Set the internal value. The 'values' of a D4Sequence is a vector of vectors of BaseType* objects. Using this method does not perform a deep copy; the BaseType*s are copied so the caller should not free them. Note that this does set d_length but the read_p flag for the BaseTypes should all be set to keep the serializer from trying to read each of them.

Parameters
values

Definition at line 268 of file D4Sequence.h.

◆ set_value_capacity()

void Vector::set_value_capacity ( uint64_t l)

Definition at line 442 of file Vector.cc.

◆ set_value_ll() [1/22]

bool Vector::set_value_ll ( dods_byte * val,
int64_t sz )
virtual

Definition at line 2029 of file Vector.cc.

◆ set_value_ll() [2/22]

bool Vector::set_value_ll ( dods_float32 * val,
int64_t sz )
virtual

Definition at line 2038 of file Vector.cc.

◆ set_value_ll() [3/22]

bool Vector::set_value_ll ( dods_float64 * val,
int64_t sz )
virtual

Definition at line 2039 of file Vector.cc.

◆ set_value_ll() [4/22]

bool Vector::set_value_ll ( dods_int16 * val,
int64_t sz )
virtual

Definition at line 2032 of file Vector.cc.

◆ set_value_ll() [5/22]

bool Vector::set_value_ll ( dods_int32 * val,
int64_t sz )
virtual

Definition at line 2034 of file Vector.cc.

◆ set_value_ll() [6/22]

bool Vector::set_value_ll ( dods_int64 * val,
int64_t sz )
virtual

Definition at line 2036 of file Vector.cc.

◆ set_value_ll() [7/22]

bool Vector::set_value_ll ( dods_int8 * val,
int64_t sz )
virtual

Definition at line 2031 of file Vector.cc.

◆ set_value_ll() [8/22]

bool Vector::set_value_ll ( dods_uint16 * val,
int64_t sz )
virtual

Definition at line 2033 of file Vector.cc.

◆ set_value_ll() [9/22]

bool Vector::set_value_ll ( dods_uint32 * val,
int64_t sz )
virtual

Definition at line 2035 of file Vector.cc.

◆ set_value_ll() [10/22]

bool Vector::set_value_ll ( dods_uint64 * val,
int64_t sz )
virtual

Definition at line 2037 of file Vector.cc.

◆ set_value_ll() [11/22]

bool Vector::set_value_ll ( string * val,
int64_t sz )
virtual

Definition at line 2066 of file Vector.cc.

◆ set_value_ll() [12/22]

bool Vector::set_value_ll ( vector< dods_byte > & val,
int64_t sz )
virtual

Definition at line 2099 of file Vector.cc.

◆ set_value_ll() [13/22]

bool Vector::set_value_ll ( vector< dods_float32 > & val,
int64_t sz )
virtual

Definition at line 2107 of file Vector.cc.

◆ set_value_ll() [14/22]

bool Vector::set_value_ll ( vector< dods_float64 > & val,
int64_t sz )
virtual

Definition at line 2108 of file Vector.cc.

◆ set_value_ll() [15/22]

bool Vector::set_value_ll ( vector< dods_int16 > & val,
int64_t sz )
virtual

Definition at line 2101 of file Vector.cc.

◆ set_value_ll() [16/22]

bool Vector::set_value_ll ( vector< dods_int32 > & val,
int64_t sz )
virtual

Definition at line 2103 of file Vector.cc.

◆ set_value_ll() [17/22]

bool Vector::set_value_ll ( vector< dods_int64 > & val,
int64_t sz )
virtual

Definition at line 2105 of file Vector.cc.

◆ set_value_ll() [18/22]

bool Vector::set_value_ll ( vector< dods_int8 > & val,
int64_t sz )
virtual

Definition at line 2100 of file Vector.cc.

◆ set_value_ll() [19/22]

bool Vector::set_value_ll ( vector< dods_uint16 > & val,
int64_t sz )
virtual

Definition at line 2102 of file Vector.cc.

◆ set_value_ll() [20/22]

bool Vector::set_value_ll ( vector< dods_uint32 > & val,
int64_t sz )
virtual

Definition at line 2104 of file Vector.cc.

◆ set_value_ll() [21/22]

bool Vector::set_value_ll ( vector< dods_uint64 > & val,
int64_t sz )
virtual

Definition at line 2106 of file Vector.cc.

◆ set_value_ll() [22/22]

bool Vector::set_value_ll ( vector< string > & val,
int64_t sz )
virtual

Definition at line 2126 of file Vector.cc.

◆ set_value_slice_from_row_major_vector()

uint64_t Vector::set_value_slice_from_row_major_vector ( const Vector & rowMajorDataC,
uint64_t startElement )
virtual

Copy rowMajorData.length() elements currently in a rowMajorData buffer into this value buffer starting at element index startElement and continuing up to startElement+rowMajorData.length()-1

This is used for aggregating together smaller rowMajor vectors into a larger one.

Note: unlike the other set_value calls, this does NOT set read_p() since it is assumed to be used as a partial read and the caller is expected to set_read_p() when the data is complete.

ASSUMES: rowMajorData.read_p() so that the data is valid! ASSUMES: this Vector has enough value_capacity() to contain all the elements such that: startElement + rowMajorData.length() <= this->value_capacity(). ASSUMES: the data type of this->var() and rowMajorData.var() MUST be non-NULL and be the same!

Parameters
rowMajorDataCthe vector from which to copy data, assumed already read in or set.
startElementthe element index (NOT byte, but rather data type element) to place the first data value.
Returns
the number of elements added, such that: startElement + the return value is the next "free" element.

Definition at line 1847 of file Vector.cc.

◆ set_vec()

void Vector::set_vec ( unsigned int i,
BaseType * val )

Sets element i to value val.

Sets an element of the vector to a given value. If the type of the input and the type of the Vector do not match, an error condition is returned.

Use this function only with Vectors containing compound types. See buf2val() or the set_value() methods to access members of Vector containing simple types.

Note
This method copies val; the caller is responsible for deleting instance passed as the actual parameter.
Returns
void
Exceptions
InternalErrThrown if i is out of range, val is null or there was a type mismatch between the BaseType referenced by val and the ith element of this Vector.
Parameters
iThe index of the element to be changed.
valA pointer to the value to be inserted into the array.
See also
Vector::buf2val

Definition at line 1556 of file Vector.cc.

◆ set_vec_ll()

void Vector::set_vec_ll ( uint64_t i,
BaseType * val )

Definition at line 1558 of file Vector.cc.

◆ set_vec_nocopy()

void Vector::set_vec_nocopy ( unsigned int i,
BaseType * val )

Sets element i to value val. Set the ith element to val. Extend the vector if needed.

Note
It is best to call vec_resize() first and allocate enough elements before calling this method.
This method does not copy val; this class will free the instance when the variable is deleted or when clear_local_data() is called.
See also
Vector::set_vec()

Definition at line 1571 of file Vector.cc.

◆ set_vec_nocopy_ll()

void Vector::set_vec_nocopy_ll ( uint64_t i,
BaseType * val )

Definition at line 1599 of file Vector.cc.

◆ size_ok()

bool libdap::size_ok ( unsigned int sz,
unsigned int nelem )

sanitize the size of an array. Test for integer overflow when dynamically allocating an array.

Parameters
nelemNumber of elements.
szsize of each element.
Returns
True if the nelem elements of sz size will overflow an array.

Definition at line 1138 of file util.cc.

◆ StrCmp()

template<class T1, class T2>
bool libdap::StrCmp ( int op,
T1 v1,
T2 v2 )

Compare two string types. This class is one implementation of the comparison policy used by rops.

See also
rops

Definition at line 166 of file Operators.h.

◆ String_to_AttrType()

AttrType libdap::String_to_AttrType ( const string & s)

Definition at line 136 of file AttrTable.cc.

◆ StringToD4AttributeType()

D4AttributeType libdap::StringToD4AttributeType ( string s)

Definition at line 109 of file D4Attributes.cc.

◆ systime()

string libdap::systime ( )

Use the system time() function to get the current time. Return a string, removing the trailing newline that time() includes in its response.

Returns
A C++ string with the current system time as formatted by time()

Definition at line 524 of file util.cc.

◆ type_name() [1/2]

string BaseType::type_name ( ) const
virtual

Returns the type of the class instance as a string.

Definition at line 335 of file BaseType.cc.

◆ type_name() [2/2]

string libdap::type_name ( Type t)

Return the type name. This function provides backward compatibility for older code that predates, and has not been ported to, DAP4. It is prejudiced toward DAP4, but if no D4 type name can be found, it types D2. If neither would return a type name, and InternalErr object is thrown.

Parameters
tThe DAP2/DAP4 type
Returns
A string naming the type, suitable for humans
Exceptions
InternalErrIf not such type can be found

Definition at line 753 of file util.cc.

◆ unescape_double_quotes()

string libdap::unescape_double_quotes ( string source)

Rip through a string and replace all the escaped double quotes with regular double quotes.

Parameters
source
Returns
result

Definition at line 481 of file escaping.cc.

◆ unescattr()

string libdap::unescattr ( string s)

Un-escape special characters, quotes and backslashes from an HDF attribute.

Note: A regex to match one \ must be defined as: Regex foo = "\\\\"; because both C++ strings and GNU's Regex also employ \ as an escape character!

Parameters
sThe escaped attribute.
Returns
The unescaped attribute.

Definition at line 407 of file escaping.cc.

◆ unhexstring()

string libdap::unhexstring ( string s)

Definition at line 88 of file escaping.cc.

◆ unique_names()

bool libdap::unique_names ( vector< BaseType * > l,
const string & var_name,
const string & type_name,
string & msg )

Definition at line 472 of file util.cc.

◆ unoctstring()

string libdap::unoctstring ( string s)

Definition at line 105 of file escaping.cc.

◆ val2buf()

unsigned int libdap::val2buf ( void * val,
bool reuse = false )
overridepure virtual

Loads class data.

Store the value pointed to by val in the object's internal buffer. This function does not perform any checks, so users must be sure that the thing pointed to can actually be stored in the object's buffer.

Only simple objects (Int, Float, Byte, and so on) and arrays of these simple objects may be stored using this function. To put data into more complex constructor types, use the functions provided by that class.

Deprecated
Use set_value() in the leaf classes.
Parameters
valA pointer to the data to be inserted into the class data buffer.
reuseA boolean value, indicating whether the class internal data storage can be reused or not. If this argument is TRUE, the class buffer is assumed to be large enough to hold the incoming data, and it is not reallocated. If FALSE, new storage is allocated. If the internal buffer has not been allocated at all, this argument has no effect. This is currently used only in the Vector class.
Returns
The size (in bytes) of the information copied from val.
See also
Grid
Vector::val2buf

◆ val2buf_ll()

int64_t Vector::val2buf_ll ( void * val,
bool reuse = false )

Definition at line 1309 of file Vector.cc.

◆ value()

void * libdap::value ( ) const
virtual

Get the values for this D4Sequence This method returns a reference to the values held by the instance. You should make sure that the instance really holds values before calling it! Do not free the BaseType*s contained in the vector of vectors.

Returns
A reference tp the vector of vector of BaseType*

Definition at line 281 of file D4Sequence.h.

◆ value_ll() [1/11]

void Vector::value_ll ( vector< uint64_t > * index,
vector< string > & b ) const
virtual

Definition at line 2270 of file Vector.cc.

◆ value_ll() [2/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_byte * b ) const
virtual

Definition at line 2226 of file Vector.cc.

◆ value_ll() [3/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_float32 * b ) const
virtual

Definition at line 2234 of file Vector.cc.

◆ value_ll() [4/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_float64 * b ) const
virtual

Definition at line 2235 of file Vector.cc.

◆ value_ll() [5/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_int16 * b ) const
virtual

Definition at line 2228 of file Vector.cc.

◆ value_ll() [6/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_int32 * b ) const
virtual

Definition at line 2230 of file Vector.cc.

◆ value_ll() [7/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_int64 * b ) const
virtual

Definition at line 2232 of file Vector.cc.

◆ value_ll() [8/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_int8 * b ) const
virtual

Definition at line 2227 of file Vector.cc.

◆ value_ll() [9/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_uint16 * b ) const
virtual

Definition at line 2229 of file Vector.cc.

◆ value_ll() [10/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_uint32 * b ) const
virtual

Definition at line 2231 of file Vector.cc.

◆ value_ll() [11/11]

void Vector::value_ll ( vector< uint64_t > * indices,
dods_uint64 * b ) const
virtual

Definition at line 2233 of file Vector.cc.

◆ value_ref()

SequenceValues & libdap::Sequence::value_ref ( )
virtual

Get the sequence values by reference This method returns a reference to the D4Sequence's values, eliminating the copy of all the pointers. For large sequences, that could be a substantial number of values (even though they are 'just' pointers).

Returns
A reference to the vector of vector of BaseType*

Get the value for this sequence.

Returns
The SequenceValues object for this Sequence.

Definition at line 291 of file D4Sequence.h.

◆ var()

BaseType * libdap::var ( const string & name = "",
bool exact_match = true,
btp_stack * s = nullptr )
overridevirtual

Returns a pointer to a member of a constructor class.

Returns a pointer to the contained variable in a composite class. The composite classes are those made up of aggregated simple data types. Array, Grid, and Structure are composite types, while Int and Float are simple types. This function is only used by composite classes. The BaseType implementation always returns null.

Several of the subclasses provide alternate access methods that make sense for that particular data type. For example, the Array class defines a *var(int i) method that returns the ith entry in the Array data, and the Structure provides a *var(Vars_iter) function using a pseudo-index to access the different members of the structure.

Parameters
nameThe name of the class member. Defaults to ""
exact_matchTrue if only interested in variables whose full names match n exactly. If false, returns the first variable whose name matches name. For example, if name is x and point.x is a variable, then var("x", false) would return a BaseType pointer to point.x. If exact_match was true then name would need to be "point.x" for var to return that pointer. This feature simplifies constraint expressions for datasets which have complex, nested, constructor variables. Defaults to true.
sRecord the path to name. Defaults to null, in which case it is not used.
Returns
A pointer to the member named in the n argument. If no name is given, the function returns the first (only) variable. For example, an Array has only one variable, while a Structure can have many.

◆ var_ll()

BaseType * Vector::var_ll ( uint64_t i)
virtual

Definition at line 567 of file Vector.cc.

◆ var_value() [1/2]

BaseType * libdap::Sequence::var_value ( size_t row,
const string & name )
virtual

Get the BaseType pointer to the named variable of a given row.

Parameters
rowRead from row in the sequence.
nameReturn name from row.
Returns
A BaseType which holds the variable and its value.
See also
number_of_rows

Definition at line 368 of file D4Sequence.cc.

◆ var_value() [2/2]

BaseType * libdap::Sequence::var_value ( size_t row,
size_t i )
virtual

Get the BaseType pointer to the $i^{th}$ variable of row.

Parameters
rowRead from row in the sequence.
iReturn the $i^{th}$ variable from row.
Returns
A BaseType which holds the variable and its value.
See also
number_of_rows

Definition at line 383 of file D4Sequence.cc.

◆ vec_resize()

void Vector::vec_resize ( int l)

Resizes a Vector. If the input length is greater than the current length of the Vector, new memory is allocated (the Vector moved if necessary), and the new entries are appended to the end of the array and padded with Null values. If the input length is shorter, the tail values are discarded.

Note
This method is applicable to the compound types only.

Definition at line 613 of file Vector.cc.

◆ vec_resize_ll()

void Vector::vec_resize_ll ( int64_t l)

Definition at line 628 of file Vector.cc.

◆ width()

unsigned int libdap::width ( bool constrained = false) const
overridevirtual

Returns the width of the data, in bytes.

Returns the number of bytes needed to hold the entire array. This is equal to length() (the number of elements in in the array) times the width of each element.

Deprecated
Use width_ll() instead

Definition at line 191 of file Vector.h.

◆ width_ll()

int64_t libdap::width_ll ( bool constrained = false) const
overridevirtual

Return the number of bytes needed to hold the array data.

Parameters
constrainedIf true, return the number of bytes given the current constraint
Returns
The number of bytes needed to hold the array data, as a 64-bit integer

Definition at line 203 of file Vector.h.

◆ www2id()

string libdap::www2id ( const string & in,
const string & escape,
const string & except )

Given a string that contains WWW escape sequences, translate those escape sequences back into the ASCII characters they represent. Return the modified string.

-Places in the dap code where www2id() is called:

  1. Array::append_dim() the name is decoded before it is added
  2. AttrTable::set_name(), AttrTable::append_attr(), AttrTable::append_container(), AttrTable::del_attr(), AttrTable::add_container_alias(), AttrTable::add_value_alias() names are decoded before that are set/used.
  3. BaseType::set_name() Names are decoded before they are set
  4. When the constraint expression parser looks for a variable, the name is first decoded.
  5. DAS::DAS() Named attribute containers are decoded
  6. DDS::var() When a DDS searches for a variable, the name is first decoded.
  7. Grid::var(), Sequence::var(), Structure::var() Variable names are decoded.

-In the server code:

  1. ResponseBuilder::initialize() The dataset name is decoded except that %20 is not removed.
  2. ResponseBuilder::set_ce() The CE is decoded, except for spaces (%20).
  3. ResponseBuilder::set_dataset_name() same logic as the first case.
  4. The ResponseBuilder methods supersede methods with the same names from DODSFilter, which is still in the code although deprecated.
Parameters
inThe string to modify.
escapeThe character used to signal the beginning of an escape sequence. default: "%"
exceptIf there are some escape codes that should not be removed by this call (e.g., you might not want to remove spaces, %20) use this parameter to specify those codes. The function will then transform all escapes except those given. For example, to suppress translation of both spaces and the ampersand, pass "%20%26" for 'except'. default: ""
Returns
The modified string.

Definition at line 202 of file escaping.cc.

◆ xml2id()

string libdap::xml2id ( string in)

Given a string that contains XML escape sequences (i.e., entities), translate those back into ASCII characters. Return the modified string.

Parameters
inThe string to modify.
Returns
The modified string.

Definition at line 301 of file escaping.cc.

◆ ~DODSFilter()

libdap::DODSFilter::~DODSFilter ( )
virtual

Definition at line 184 of file DODSFilter.cc.

Variable Documentation

◆ c_dap40_namespace

const string libdap::c_dap40_namespace = "http://xml.opendap.org/ns/DAP/4.0#"

Definition at line 40 of file DMR.h.

◆ d_action

string libdap::d_action
protected

Definition at line 106 of file DODSFilter.h.

◆ d_anc_das_lmt

time_t libdap::d_anc_das_lmt
protected

Definition at line 110 of file DODSFilter.h.

◆ d_anc_dds_lmt

time_t libdap::d_anc_dds_lmt
protected

Definition at line 111 of file DODSFilter.h.

◆ d_anc_dir

string libdap::d_anc_dir
protected

Definition at line 100 of file DODSFilter.h.

◆ d_anc_file

string libdap::d_anc_file
protected

Definition at line 101 of file DODSFilter.h.

◆ d_bad_options

bool libdap::d_bad_options
protected

Definition at line 93 of file DODSFilter.h.

◆ d_cache_dir

string libdap::d_cache_dir
protected

Definition at line 102 of file DODSFilter.h.

◆ d_cgi_ver

string libdap::d_cgi_ver
protected

Definition at line 99 of file DODSFilter.h.

◆ d_comp

bool libdap::d_comp
protected

Definition at line 92 of file DODSFilter.h.

◆ d_conditional_request

bool libdap::d_conditional_request
protected

Definition at line 94 of file DODSFilter.h.

◆ d_dap2ce

string libdap::d_dap2ce
protected

Definition at line 98 of file DODSFilter.h.

◆ d_dataset

string libdap::d_dataset
protected

Definition at line 97 of file DODSFilter.h.

◆ d_if_modified_since

time_t libdap::d_if_modified_since
protected

Definition at line 112 of file DODSFilter.h.

◆ d_program_name

string libdap::d_program_name
protected

Definition at line 96 of file DODSFilter.h.

◆ d_response

Response libdap::d_response
protected

Definition at line 105 of file DODSFilter.h.

◆ d_timeout

int libdap::d_timeout
protected

Definition at line 108 of file DODSFilter.h.

◆ d_url

string libdap::d_url
protected

Definition at line 103 of file DODSFilter.h.

◆ dods_keep_temps

int libdap::dods_keep_temps = 0

Definition at line 81 of file HTTPConnect.cc.

◆ DODS_MAX_ARRAY

const int libdap::DODS_MAX_ARRAY = DODS_INT_MAX

Definition at line 60 of file Array.h.

◆ double_quote

const string libdap::double_quote = "\""

Definition at line 1116 of file AttrTable.cc.

◆ line_length

const size_t libdap::line_length = 1024

Definition at line 760 of file mime_util.cc.

◆ max_str_len

const unsigned int libdap::max_str_len = DODS_USHRT_MAX - 1

Definition at line 53 of file Str.h.

◆ max_url_len

const unsigned int libdap::max_url_len = 255

Definition at line 49 of file Url.h.

◆ usage

const string libdap::usage
Initial value:
= "Usage: <handler name> -o <response> -u <url> [options ...] [data set]\n\
\n\
options: -o <response>: DAS, DDS, DataDDS, DDX, BLOB or Version (Required)\n\
-u <url>: The complete URL minus the CE (required for DDX)\n\
-c: Compress the response using the deflate algorithm.\n\
-e <expr>: When returning a DataDDS, use <expr> as the constraint.\n\
-v <version>: Use <version> as the version number\n\
-d <dir>: Look for ancillary file in <dir> (deprecated).\n\
-f <file>: Look for ancillary data in <file> (deprecated).\n\
-r <dir>: Use <dir> as a cache directory\n\
-l <time>: Conditional request; if data source is unchanged since\n\
<time>, return an HTTP 304 response.\n\
-t <seconds>: Timeout the handler after <seconds>.\n\
-h: This message."

Definition at line 89 of file DODSFilter.cc.

◆ www_trace

int libdap::www_trace = 0

Definition at line 75 of file HTTPConnect.cc.

◆ www_trace_extensive

int libdap::www_trace_extensive = 0

Definition at line 78 of file HTTPConnect.cc.