28 #include "boost/regex.hpp"
36 const boost::regex intRegex(
"(\\Q+\\E|\\Q-\\E){0,1}[0-9]+");
37 const boost::regex doubleRegex(
"(\\Q+\\E|\\Q-\\E){0,1}([0-9]*\\.[0-9]+|[0-9]+\\.[0-9]*)((e|E)(\\Q+\\E|\\Q-\\E){0,1}[0-9]+){0,1}");
38 const boost::regex FitsStringRegex(
"'(.*)'");
40 boost::smatch matchStrings;
42 std::istringstream converter(valueString);
44 if (boost::regex_match(valueString, intRegex)) {
51 if (boost::regex_match(valueString, doubleRegex)) {
54 converter >> doubleVal;
58 if (boost::regex_match(valueString, matchStrings, FitsStringRegex)) {
67 std::string envVar = packageName;
69 transform(envVar.begin(), envVar.end(), envVar.begin(), (int (*)(int)) toupper);
72 char const *dir = getenv(envVar.c_str());
74 throw LSST_EXCEPT(lsst::pex::exceptions::NotFoundError,
"Package " + packageName +
" not found");
std::string getPackageDir(std::string const &packageName)
return the root directory of a setup package
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
#define LSST_EXCEPT(type,...)
boost::any stringToAny(std::string valueString)
Include files required for standard LSST Exception handling.