libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
parser-util.cc File Reference
#include "config.h"
#include <cassert>
#include <cerrno>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <sstream>
#include "Error.h"
#include "debug.h"
#include "dods-limits.h"
#include "parser.h"
#include "util.h"
Include dependency graph for parser-util.cc:

Go to the source code of this file.

Namespaces

namespace  libdap
 top level DAP object to house generic methods
 

Functions

int libdap::check_byte (const char *val)
 Is the value a valid byte?
 
int libdap::check_float32 (const char *val)
 
int libdap::check_float64 (const char *val)
 
int libdap::check_float64 (const char *val, double &v)
 
int libdap::check_int16 (const char *val)
 
int libdap::check_int32 (const char *val)
 
int libdap::check_int32 (const char *val, int &v)
 
int libdap::check_int64 (const char *val)
 
int libdap::check_uint16 (const char *val)
 
int libdap::check_uint32 (const char *val)
 
int libdap::check_uint32 (const char *val, unsigned int &v)
 
int libdap::check_uint64 (const char *val)
 
int libdap::check_url (const char *val)
 Is the value a valid URL?
 
double libdap::get_float64 (const char *val)
 
int libdap::get_int32 (const char *val)
 
long long libdap::get_int64 (const char *val)
 
unsigned int libdap::get_uint32 (const char *val)
 
unsigned long long libdap::get_uint64 (const char *val)
 
bool libdap::is_keyword (string id, const string &keyword)
 
void libdap::parse_error (const char *msg, const int line_num, const char *context)
 
void libdap::save_str (std::string &dst, const char *src, const int)
 Save a string to a temporary variable during the parse.
 
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 libdap::parse_error (const string &msg, const int line_num, const char *context)
 
void libdap::parse_error (parser_arg *arg, const char *msg, const int line_num, const char *context)