OTB
9.0.0
Orfeo Toolbox
|
Functions | |
template<typename T > | |
void | ConvertStringToVector (std::string const &str, T &ret, std::string const &errmsg, const char *delims=" ") |
template<class T > | |
std::string | ConvertToString (const T &v) |
bool OTBCommon_EXPORT | IsLonLatValid (double lon, double lat) |
template<typename Res , typename In > | |
Res | LexicalCast (In const &in, std::string const &kind) |
void OTBCommon_EXPORT | PrintNothing (const char *s) |
template<typename T > | |
void | SplitStringToSingleKeyValue (const std::string &str, std::string &key, T &value, const T &defValue, std::string const &errmsg, const std::string delims="=") |
Variables | |
OTBCommon_EXPORT const bool | FalseConstant |
OTBCommon_EXPORT const bool | TrueConstant |
void otb::Utils::ConvertStringToVector | ( | std::string const & | str, |
T & | ret, | ||
std::string const & | errmsg, | ||
const char * | delims = " " |
||
) |
Converts a delimiter separated string into a collection of T's
.
Collection | type. It shall define value_type and push_back() |
[out] | ret | output collection. |
[in] | str | input string |
[in] | errmsg | a msg complement used to build the error message to be shown if there is lexical_cast exception. See otb:Utils: :LexicalCast(). |
delims | delimiter characters (space is default) |
std::bad_alloc | in case of exhausted memory |
std::runtime_error | in case an element from the input string cannot be converted into a valid T instance. |
otb::Utils::LexicalCast()
Definition at line 83 of file otbStringUtils.h.
Referenced by otb::ImageFileWriter< TImage >::GenerateOutputInformation(), and otb::MultiImageFileWriter::Sink< TImage >::GetRegionToWrite().
|
inline |
Definition at line 47 of file otbUtils.h.
bool OTBCommon_EXPORT otb::Utils::IsLonLatValid | ( | double | lon, |
double | lat | ||
) |
Check that the values for lon, lat are reasonable
|
inline |
Definition at line 52 of file otbStringUtils.h.
void OTBCommon_EXPORT otb::Utils::PrintNothing | ( | const char * | s | ) |
Function that prints nothing (useful to disable libsvm logs)
Referenced by otb::LibSVMMachineLearningModel< TInputValue, TTargetValue >::LibSVMMachineLearningModel().
void otb::Utils::SplitStringToSingleKeyValue | ( | const std::string & | str, |
std::string & | key, | ||
T & | value, | ||
const T & | defValue, | ||
std::string const & | errmsg, | ||
const std::string | delims = "=" |
||
) |
split a given std::string of into key value based on given delimiter string. The default delimiter is '='. If the string does not have a delimiter the key is set to input string and value is set to defValue.
[in] | str | input string |
key[out] | An std::string reference where key will be stored | |
value[out] | a reference of \cT where value will be stored | |
defValue[in] | a default value if there is no delimiter | |
[in] | errmsg | a msg complement used to build the error message to be shown if there is lexical_cast exception. See \cotb:Utils::LexicalCast(). |
delims | delimiter characters (space is default) |
std::bad_alloc | in case of exhausted memory |
std::runtime_error | in case an element from the input string cannot be converted into a valid T instance. |
otb::Utils::LexicalCast()
Definition at line 117 of file otbStringUtils.h.
OTBCommon_EXPORT const bool otb::Utils::FalseConstant |
OTBCommon_EXPORT const bool otb::Utils::TrueConstant |