#include <ConfigFile.h>
Definition at line 54 of file ConfigFile.h.
lsst::meas::algorithms::shapelet::ConvertibleString::ConvertibleString |
( |
| ) |
|
|
inline |
lsst::meas::algorithms::shapelet::ConvertibleString::ConvertibleString |
( |
const std::string |
s | ) |
|
|
inline |
template<typename T >
lsst::meas::algorithms::shapelet::ConvertibleString::ConvertibleString |
( |
const T & |
x | ) |
|
|
inlineexplicit |
template<typename T >
lsst::meas::algorithms::shapelet::ConvertibleString::ConvertibleString |
( |
const std::vector< T > & |
x | ) |
|
|
inlineexplicit |
lsst::meas::algorithms::shapelet::ConvertibleString::~ConvertibleString |
( |
| ) |
|
|
inline |
template<typename T >
lsst::meas::algorithms::shapelet::ConvertibleString::operator std::vector< T > |
( |
| ) |
const |
|
inline |
Definition at line 141 of file ConfigFile.h.
143 #ifdef Use_Zero_Default
144 if (*
this ==
"")
return std::vector<T>();
147 std::string err=
"Could not convert ConvertibleString to input type ";
148 err += std::string(
"std::vector<")+
typeid(T).
name()+
">";
149 err += std::string(
": this = ") + *
this;
152 if ((*
this)[0] ==
'{') {
155 int i1 = this->find_first_not_of(
" \t\n\r\f",1);
156 if (i1 ==
int(std::string::npos)) {
158 std::cerr<<err<<std::endl;
160 return std::vector<T>();
162 throw ParameterException(err);
165 if ((*
this)[i1] ==
'}') {
167 return std::vector<T>();
170 int nComma = std::count(this->begin(),this->end(),
',');
171 std::vector<T> ret(nComma+1);
173 int i2 = this->find_first_of(
"},",i1);
176 while ((*
this)[i2] !=
'}') {
177 std::string s = this->substr(i1,i2-i1);
178 std::stringstream ss(s);
181 i2 = this->find_first_of(
"},",i1);
185 std::string s = this->substr(i1,i2-i1);
186 std::stringstream ss(s);
190 throw ParameterException(err);
195 std::stringstream ss(*
this);
198 while (ss >> x) ret.push_back(x);
table::Key< std::string > name
template<typename T >
lsst::meas::algorithms::shapelet::ConvertibleString::operator T |
( |
| ) |
const |
|
inline |
Definition at line 98 of file ConfigFile.h.
101 if (is_bool<T>::value) {
106 #ifdef Use_Zero_Default
107 if (*
this ==
"")
return T();
110 std::string err=
"Could not convert ConvertibleString to input type ";
111 err +=
typeid(T).
name();
112 err += std::string(
": this = ") + *
this;
114 std::stringstream ss(*
this);
119 if (std::numeric_limits<T>::is_integer) {
120 if ((*
this)[0] ==
'0') {
121 if ((*
this)[1] ==
'x' || (*
this)[1] ==
'X') {
131 std::cerr<<err<<std::endl;
134 throw ParameterException(err);
bool operator_bool() const
table::Key< std::string > name
ConvertibleString& lsst::meas::algorithms::shapelet::ConvertibleString::operator= |
( |
const std::string & |
rhs | ) |
|
|
inline |
Definition at line 71 of file ConfigFile.h.
73 std::string::operator=(rhs);
template<typename T >
ConvertibleString& lsst::meas::algorithms::shapelet::ConvertibleString::operator= |
( |
const T & |
x | ) |
|
|
inline |
template<typename T >
ConvertibleString& lsst::meas::algorithms::shapelet::ConvertibleString::operator= |
( |
const std::vector< T > & |
x | ) |
|
|
inline |
Definition at line 87 of file ConfigFile.h.
89 std::stringstream oss;
90 const int n = x.size();
91 if (n > 0) oss << x[0];
92 for(
int i=1;i<n;++i) oss <<
' ' << x[i];
bool lsst::meas::algorithms::shapelet::ConvertibleString::operator_bool |
( |
| ) |
const |
|
inlineprivate |
Definition at line 207 of file ConfigFile.h.
209 #ifdef Use_Zero_Default
210 if (*
this ==
"")
return false;
214 std::string sup = *
this;
215 for ( std::string::iterator p = sup.begin(); p != sup.end(); ++p )
218 if ( sup==
"FALSE" || sup==
"F" || sup==
"NO" || sup==
"N" ||
219 sup==
"0" || sup==
"NONE" ) {
221 }
else if ( sup==
"TRUE" || sup==
"T" || sup==
"YES" || sup==
"Y" ||
226 "Could not convert ConvertibleString to input type bool"
229 std::cerr<<err<<std::endl;
233 throw ParameterException(err);
The documentation for this class was generated from the following file:
- /home/lsstsw/stack/Linux64/meas_algorithms/11.0-2-gb8b8ce7/include/lsst/meas/algorithms/shapelet/ConfigFile.h