|
OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
|
Static class of utility functions. More...
#include <NCMLUtil.h>

Public Member Functions | |
| ~NCMLUtil () | |
Static Public Member Functions | |
| static void | copyVariablesAndAttributesInto (libdap::DDS *dds_out, const libdap::DDS &dds_in) |
| Make a deep copy of the global attributes and variables within dds_in into *dds_out. More... | |
| static libdap::DDS * | getDDSFromEitherResponse (BESDapResponse *response) |
| Return the DDS* for the given response object. More... | |
| static void | hackGlobalAttributesForDAP2 (libdap::AttrTable &global_attributes, const std::string &global_container_name) |
| static bool | isAllWhitespace (const std::string &str) |
| Is all the string whitespace as defined by chars in WHITESPACE ? More... | |
| static bool | isAscii (const std::string &str) |
| Does the string contain only ASCII 7-bit characters according to isascii()? More... | |
| static void | populateDASFromDDS (libdap::DAS *das, const libdap::DDS &dds_const) |
| Given we have a valid attribute tree inside of the DDS, recreate it in the DAS. More... | |
| static void | setVariableNameProperly (libdap::BaseType *pVar, const std::string &name) |
| Currently BaseType::set_name only sets in BaseType. More... | |
| static int | tokenize (const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters=" \t") |
| Split str into tokens using the characters in delimiters as split boundaries. More... | |
| static int | tokenizeChars (const std::string &str, std::vector< std::string > &tokens) |
| Split str into a vector with one char in str per token slot. More... | |
| static bool | toUnsignedInt (const std::string &stringVal, unsigned int &oVal) |
| Convert the string to an unsigned int into oVal. More... | |
| static void | trim (std::string &str, const std::string &trimChars=WHITESPACE) |
| Trim from both left and right. More... | |
| static void | trimAll (std::vector< std::string > &tokens, const std::string &trimChars=WHITESPACE) |
| Call trim on each string in tokens. More... | |
| static void | trimLeft (std::string &str, const std::string &trimChars=WHITESPACE) |
| Trim off any number of any character in trimChars from the left side of str in place. More... | |
| static void | trimRight (std::string &str, const std::string &trimChars=WHITESPACE) |
| Trim off any number of any character in trimChars from the right side of str in place. More... | |
Static Public Attributes | |
| static const std::string | WHITESPACE = " \t\n" |
| Delimiter set for tokenizing whitespace separated data. More... | |
Static class of utility functions.
Definition at line 72 of file NCMLUtil.h.
|
inline |
Definition at line 76 of file NCMLUtil.h.
|
static |
Make a deep copy of the global attributes and variables within dds_in into *dds_out.
Doesn't affect any other top-level data.
| dds_out | place to copy global attribute table and variables into |
| dds_in | source DDS |
Definition at line 256 of file NCMLUtil.cc.
References VALID_PTR.
Referenced by ncml_module::NCMLRequestHandler::ncml_build_dds().
|
static |
Return the DDS* for the given response object.
It is assumed to be either a BESDDSResponse or BESDataDDSResponse.
| reponse | either a BESDDSResponse or BESDataDDSResponse to extract DDS from. |
Definition at line 282 of file NCMLUtil.cc.
References BESDEBUG, BESDDSResponse::get_dds(), and BESDataDDSResponse::get_dds().
Referenced by ncml_module::NetcdfElement::getDDS(), agg_util::DDSLoader::loadInto(), ncml_module::NCMLRequestHandler::ncml_build_das(), ncml_module::NCMLRequestHandler::ncml_build_data(), ncml_module::NCMLRequestHandler::ncml_build_dds(), and ncml_module::NCMLRequestHandler::ncml_build_dmr().

|
static |
Definition at line 318 of file NCMLUtil.cc.
Referenced by ncml_module::NCMLRequestHandler::ncml_build_das(), and ncml_module::NCMLRequestHandler::ncml_build_dds().
|
static |
Is all the string whitespace as defined by chars in WHITESPACE ?
Definition at line 110 of file NCMLUtil.cc.
Referenced by ncml_module::RemoveElement::handleContent(), ncml_module::ExplicitElement::handleContent(), ncml_module::ReadMetadataElement::handleContent(), ncml_module::ValuesElement::handleContent(), ncml_module::AttributeElement::handleContent(), ncml_module::DimensionElement::handleContent(), ncml_module::VariableElement::handleContent(), ncml_module::NetcdfElement::handleContent(), ncml_module::AggregationElement::handleContent(), and ncml_module::NCMLElement::handleContent().
|
static |
Does the string contain only ASCII 7-bit characters according to isascii()?
Definition at line 96 of file NCMLUtil.cc.
Referenced by ncml_module::NCMLParser::checkDataIsValidForCanonicalTypeOrThrow().
|
static |
Given we have a valid attribute tree inside of the DDS, recreate it in the DAS.
| das | the das to clear and populate |
| dds_const | the source dds |
Definition at line 200 of file NCMLUtil.cc.
References BESDEBUG, and VALID_PTR.
Referenced by ncml_module::NCMLRequestHandler::ncml_build_das().
|
static |
Currently BaseType::set_name only sets in BaseType.
Unfortunately, the DDS transmission for Vector subclasses uses the name of the template BaseType* describing the variable, which is not set by set_name. This is a workaround until Vector overrides BaseType::set_name to also set the name of the template _var if there is one.
Definition at line 398 of file NCMLUtil.cc.
References VALID_PTR.
|
static |
Split str into tokens using the characters in delimiters as split boundaries.
Return the number of tokens appended to tokens.
Definition at line 54 of file NCMLUtil.cc.
References BESDEBUG.
Referenced by ncml_module::ValuesElement::handleContent(), and ncml_module::ValuesElement::handleEnd().
|
static |
Split str into a vector with one char in str per token slot.
Definition at line 82 of file NCMLUtil.cc.
Referenced by ncml_module::ValuesElement::handleContent(), and ncml_module::ValuesElement::handleEnd().
|
static |
Convert the string to an unsigned int into oVal.
Return success, else oVal is invalid on return.
| stringVal | val to parse |
| oVal | location to place parsed result |
Definition at line 146 of file NCMLUtil.cc.
Referenced by ncml_module::NetcdfElement::getNcoordsAsUnsignedInt().
|
inlinestatic |
Trim from both left and right.
Definition at line 117 of file NCMLUtil.h.
References trimLeft(), and trimRight().

|
static |
Call trim on each string in tokens.
tokens is mutated to contain the trimmed strings.
Definition at line 136 of file NCMLUtil.cc.
|
static |
Trim off any number of any character in trimChars from the left side of str in place.
Definition at line 116 of file NCMLUtil.cc.
Referenced by trim().
|
static |
Trim off any number of any character in trimChars from the right side of str in place.
Trim off any number of any character in trimChars from the right side of input.
Definition at line 126 of file NCMLUtil.cc.
Referenced by trim().
|
static |
Delimiter set for tokenizing whitespace separated data.
Currently " \t"
Definition at line 79 of file NCMLUtil.h.
Referenced by ncml_module::ValuesElement::handleContent(), ncml_module::ValuesElement::handleEnd(), ncml_module::ValuesElement::toString(), and ncml_module::AttributeElement::toString().