29 #ifndef __NCML_MODULE_NCML_UTIL_H__
30 #define __NCML_MODULE_NCML_UTIL_H__
64 #define SAFE_DELETE(a) { delete (a); (a) = 0; }
86 const std::string& str,
87 std::vector<std::string>& tokens,
88 const std::string& delimiters =
" \t");
92 const std::string& str,
93 std::vector<std::string>& tokens);
98 static bool isAscii(
const std::string& str);
107 const std::string& trimChars = WHITESPACE);
113 const std::string& trimChars = WHITESPACE);
119 const std::string& trimChars = WHITESPACE)
129 std::vector<std::string>& tokens,
130 const std::string& trimChars = WHITESPACE);
139 static bool toUnsignedInt(
const std::string& stringVal,
unsigned int& oVal);
154 libdap::DDS* dds_out,
155 const libdap::DDS& dds_in);
173 libdap::BaseType* pVar,
174 const std::string& name);
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.
static bool isAscii(const std::string &str)
Does the string contain only ASCII 7-bit characters according to isascii()?
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.
An abstract superclass for NCMLArray that handles the non-parameterized functionality and allows u...
static bool isAllWhitespace(const std::string &str)
Is all the string whitespace as defined by chars in WHITESPACE ?
static libdap::DDS * getDDSFromEitherResponse(BESDapResponse *response)
Return the DDS* for the given response object.
static bool toUnsignedInt(const std::string &stringVal, unsigned int &oVal)
Convert the string to an unsigned int into oVal.
static class NCMLUtil overview
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.
static void trim(std::string &str, const std::string &trimChars=WHITESPACE)
Trim from both left and right.
Static class of utility functions.
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.
static void setVariableNameProperly(libdap::BaseType *pVar, const std::string &name)
Currently BaseType::set_name only sets in BaseType.
Represents an OPeNDAP DAP response object within the BES.
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.
static void hackGlobalAttributesForDAP2(libdap::AttrTable &global_attributes, const std::string &global_container_name)
static void trimAll(std::vector< std::string > &tokens, const std::string &trimChars=WHITESPACE)
Call trim on each string in tokens.
static const std::string WHITESPACE
Delimiter set for tokenizing whitespace separated data.
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.