Request for Changes-6: Helper functions for string operations using boost
[Request for Changes - 6] Helper functions for string operations using boost
- Author: Rashad Kanavath
- Submitted on 22.09.2015
- Proposed target release : 5.2
- Git branch : https://git.orfeo-toolbox.org/otb.git/shortlog/refs/heads/string_utils
specialize boost lexical_cast for primitive types and two split functions to string.
boost::lexical_cast is used in many places directly in OTB. For example see this class. This RFC propose to avoid usage of boost string operations directly in OTB headers. All string based operations such as lexical_cast(convert string), split string to vector, split to key-value pairs must be used via otbStringUtils.h
Classes and files
The below function are included in this header :
- specialized lexical_cast for int, float, double.
- ConvertStringToVector - convert a string to vector. used in parsing date time from UTC string. see this class. The same is repeated in other ImageMetadataInterface classes
- SplitStringToSingleKeyValue - split a string to key, val with a delimiter. This is again useful to parsing metadata
The functions are adequately commented in the header.