DATRW++ library: seismic data I/O with multiple formats

◆ makeparamap()

Tparamap datrw::formatmodifiers::makeparamap ( const std::string &  p,
const std::string &  delimiter = ":",
const std::string &  assign = "=" 
)

Create a parameter map from a parameter string.

Parameters
pparameter string
delimiterdelimiter which separates two parameters
assignsymbol seprating key and value
Returns
a multimap created from the parameter string

Definition at line 51 of file formatmodifier.cc.

References datrw::util::clipstring(), and datrw::util::trimws().

54  {
55  std::string parameters=p;
56  Tparamap retval;
57  while (parameters.length()>0)
58  {
59  std::string value=datrw::util::clipstring(parameters, delimiter);
60  std::string key
62  if (value.length()==0)
63  {
64  retval[key]=Value("true");
65  }
66  else
67  {
68  retval[key]=Value(value);
69  }
70  } // while (parameters.length()>0)
71  return retval;
72  } // Tparamap makeparamap()
std::string trimws(std::string s)
remove leading and trailing whitespace
Definition: util.cc:129
std::map< std::string, Value > Tparamap
A map to store parameters.
std::string clipstring(std::string &s, const std::string &delim)
strip substringStrips off first substring up to given delimiter. The string is passed as a reference ...
Definition: util.cc:105
Here is the call graph for this function: