| 1000 | } |
| 1001 | |
| 1002 | std::string OSRunner::cleanValueName(const std::string& name) { |
| 1003 | static const boost::regex allowableCharacters("[^0-9a-zA-Z]"); |
| 1004 | static const boost::regex leadingUnderscore("^_+"); |
| 1005 | static const boost::regex trailingUnderscore("_+$"); |
| 1006 | static const boost::regex leadingNumber("^([0-9])"); |
| 1007 | static const boost::regex multipleUnderscore("[_]+"); |
| 1008 | |
| 1009 | std::string result = boost::regex_replace(name, allowableCharacters, "_"); |
| 1010 | result = boost::regex_replace(result, leadingUnderscore, ""); |
| 1011 | result = boost::regex_replace(result, trailingUnderscore, ""); |
| 1012 | result = boost::regex_replace(result, leadingNumber, "_$1"); |
| 1013 | result = boost::regex_replace(result, multipleUnderscore, "_"); |
| 1014 | result = toUnderscoreCase(result); |
| 1015 | return result; |
| 1016 | } |
| 1017 | |
| 1018 | void OSRunner::captureStreams() { |
| 1019 | if (m_streamsCaptured) { |
nothing calls this directly
no test coverage detected