libpniio
Functions
strutils.hpp File Reference

Go to the source code of this file.

Functions

std::string strip (std::string &s, const char *begrem="\n ", const char *endrem=" \n")
 strips a string More...
 
int get_key_value (std::string &s, const char *del, std::string &key, std::string &value)
 split into key value pairs More...
 

Function Documentation

int get_key_value ( std::string &  s,
const char *  del,
std::string &  key,
std::string &  value 
)

Function splits a string into a "key"/"value" pair according to a delimiter symbol.

Parameters
sstring to split
deldelimiter string
keyreference to the key
valuereference to the value portion of the original string
std::string strip ( std::string &  s,
const char *  begrem = "\n ",
const char *  endrem = " \n" 
)

function strips leading and trailing signs from a string object

Parameters
sstring to strip
begremstring with signs to remove from the beginning
endremstring with signs to remove from the end of the string
Returns
new string with stripped content