OTB  6.3.0
Orfeo Toolbox
Functions
otb::Utils Namespace Reference

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)
 
int OTBOSSIMAdapters_EXPORT GetZoneFromGeoPoint (double lon, double lat)
 
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="=")
 

Function Documentation

template<typename T >
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.

Template Parameters
Collectiontype. It shall define value_type and push_back()
Parameters
[out]retoutput collection.
[in]strinput string
[in]errmsga msg complement used to build the error message to be shown if there is lexical_cast exception. See otb:Utils::LexicalCast().
delimsdelimitter characters (space is default)
Exceptions
std::bad_allocin case of exhausted memory
std::runtime_errorin case an element from the input string cannot be converted into a valid T instance.
Precondition
delims shall not be null (untested)
See Also
otb::Utils::LexicalCast()

Definition at line 82 of file otbStringUtils.h.

Referenced by otb::ImageFileWriter< TInputImage >::Update().

template<class T >
std::string otb::Utils::ConvertToString ( const T &  v)
inline

Definition at line 44 of file otbUtils.h.

Referenced by otb::LambertConformalConicMapProjection< TTransform >::SetAllParameters(), otb::MollweidMapProjection< TTransform >::SetFalseEasting(), otb::TransMercatorMapProjection< TTransform >::SetFalseEasting(), otb::Eckert4MapProjection< TTransform >::SetFalseEasting(), otb::SinusoidalMapProjection< TTransform >::SetFalseEasting(), otb::LambertConformalConicMapProjection< TTransform >::SetFalseEasting(), otb::MollweidMapProjection< TTransform >::SetFalseNorthing(), otb::Eckert4MapProjection< TTransform >::SetFalseNorthing(), otb::TransMercatorMapProjection< TTransform >::SetFalseNorthing(), otb::SinusoidalMapProjection< TTransform >::SetFalseNorthing(), otb::LambertConformalConicMapProjection< TTransform >::SetFalseNorthing(), otb::UtmMapProjection< TTransform >::SetHemisphere(), otb::MollweidMapProjection< TTransform >::SetParameters(), otb::TransMercatorMapProjection< TTransform >::SetParameters(), otb::Eckert4MapProjection< TTransform >::SetParameters(), otb::SinusoidalMapProjection< TTransform >::SetParameters(), otb::TransMercatorMapProjection< TTransform >::SetScaleFactor(), otb::LambertConformalConicMapProjection< TTransform >::SetStandardParallel1(), otb::LambertConformalConicMapProjection< TTransform >::SetStandardParallel2(), otb::LambertConformalConicMapProjection< TTransform >::SetStandardParallels(), otb::UtmMapProjection< TTransform >::SetZone(), and otb::UtmMapProjection< TTransform >::SetZoneAndHemisphereFromGeoPoint().

int OTBOSSIMAdapters_EXPORT otb::Utils::GetZoneFromGeoPoint ( double  lon,
double  lat 
)
bool OTBCommon_EXPORT otb::Utils::IsLonLatValid ( double  lon,
double  lat 
)

Check that the values for lon, lat are reasonable

template<typename Res , typename In >
Res otb::Utils::LexicalCast ( In const &  in,
std::string const &  kind 
)
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().

template<typename T >
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 delimitter string. default delimitter is '='. If the string does not have a delimitter the key is set to input string and value is set to defValue.

Parameters
[in]strinput string
key[out]An std::string reference where key will be stored
value[out]a reference of where value will be stored
defValue[in]a default value if there is no delimitter fo
[in]errmsga msg complement used to build the error message to be shown if there is lexical_cast exception. See :Utils::LexicalCast().
delimsdelimitter characters (space is default)
Exceptions
std::bad_allocin case of exhausted memory
std::runtime_errorin case an element from the input string cannot be converted into a valid T instance.
Precondition
delims shall not be null (untested)
See Also
otb::Utils::LexicalCast()

Definition at line 116 of file otbStringUtils.h.