MCPcopy Create free account
hub / github.com/RcppCore/Rcpp / Param

Method Param

src/attributes.cpp:1053–1071  ·  view source on GitHub ↗

Parse attribute parameter from parameter text

Source from the content-addressed store, hash-verified

1051
1052 // Parse attribute parameter from parameter text
1053 Param::Param(const std::string& paramText)
1054 {
1055 // parse out name/value pair if there is one
1056 std::string::size_type pos = paramText.find("=") ;
1057 if ( pos != std::string::npos ) {
1058 // name
1059 name_ = paramText.substr(0, pos); // #nocov start
1060 trimWhitespace(&name_);
1061 // value
1062 value_ = paramText.substr(pos + 1) ;
1063 trimWhitespace(&value_);
1064 stripQuotes(&value_); // #nocov end
1065 }
1066 else {
1067 name_ = paramText;
1068 trimWhitespace(&name_);
1069 stripQuotes(&name_);
1070 }
1071 }
1072
1073 // Check if the attribute has a parameter of a paricular name
1074 Param Attribute::paramNamed(const std::string& name) const {

Callers

nothing calls this directly

Calls 2

trimWhitespaceFunction · 0.85
stripQuotesFunction · 0.85

Tested by

no test coverage detected