MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / replaceUnitString

Function replaceUnitString

src/utilities/units/UnitFactory.cpp:702–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

700}
701
702std::string replaceUnitString(const std::string& text, const std::string& newUnitString) {
703 std::string toReplace = extractUnitString(text);
704 std::string result(text);
705 if (!toReplace.empty()) {
706 result =
707 boost::regex_replace(text, boost::regex(toReplace, boost::regex_constants::literal), newUnitString, boost::regex_constants::format_literal);
708 }
709 return result;
710}
711
712bool isUnitString(const std::string& unitString) {
713 OptionalUnit unit = createUnit(unitString);

Callers

nothing calls this directly

Calls 2

extractUnitStringFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected