12 #ifndef StringManipulator_H 13 #define StringManipulator_H 28 return val < 0 ?
'-' :
'0';
69 std::string::size_type
size()
const {
return str().size(); }
87 const std::vector<std::string>&
split(
std::string seps,
bool fullSplit =
false);
116 int toInt(
int valbad =0)
const;
122 float toFloat(
float valbad =0)
const;
138 bool havesub =
false;
139 std::string::size_type ipos =
m_str.find(ssubout);
141 while ( ipos != std::string::npos ) {
143 std::ostringstream sssubin;
145 ssubin = sssubin.str();
147 std::string::size_type lout = ssubout.size();
148 m_str.replace(ipos, lout, ssubin);
149 ipos =
m_str.find(ssubout, ipos+lout);
161 char cfill = getFill<T>(xsubin);
162 bool havesub =
false;
163 std::string::size_type ipos =
m_str.find(ssubout);
165 while ( ipos != std::string::npos ) {
167 std::ostringstream sssubin;
169 sssubin.width(width);
171 ssubin = sssubin.str();
173 std::string::size_type lout = ssubout.size();
174 m_str.replace(ipos, lout, ssubin);
175 ipos =
m_str.find(ssubout, ipos+lout);
const StringVector & patternSplit(std::string spat)
static std::string floatToString(float val, int prec, bool trunc, std::string sdot="", std::string smin="")
const std::vector< std::string > & split(std::string seps, bool fullSplit=false)
int replace(std::string substr, const T &xsub)
const std::string & str() const
std::string::size_type size() const
unsigned int toUnsignedInt(unsigned int valbad=0) const
const StringVector & splits() const
void setLogLevel(Index logLevel)
StringManipulator(const char *chin)
const char * c_str() const
static char getFill(typename std::enable_if< std::is_integral< T >::value, const T & >::type val)
int toInt(int valbad=0) const
int replaceFixedWidth(std::string substr, const T &xsub, Index width)
StringManipulator(const std::string &sin)
StringManipulator(std::string &strin, bool copy)
std::vector< std::string > StringVector
bool isUnsignedInt() const
static char getFill(typename std::enable_if<!std::is_integral< T >::value, const T & >::type val)
float toFloat(float valbad=0) const