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

Method getStringArgumentValue

src/measure/OSRunner.cpp:718–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

716 }
717
718 std::string OSRunner::getStringArgumentValue(const std::string& argument_name, const std::map<std::string, OSArgument>& user_arguments) {
719 std::stringstream ss;
720
721 auto it = user_arguments.find(argument_name);
722 if (it != user_arguments.end()) {
723 if (it->second.hasValue()) {
724 return it->second.valueAsString();
725 } else if (it->second.hasDefaultValue()) {
726 return it->second.defaultValueAsString();
727 }
728 }
729
730 ss << "No value found for argument '" << argument_name << "'.";
731 if (it != user_arguments.end()) {
732 ss << " Full argument as passed in by user:" << '\n' << it->second;
733 }
734 registerError(ss.str());
735 LOG_AND_THROW(ss.str());
736 return {};
737 }
738
739 boost::optional<std::string> OSRunner::getOptionalStringArgumentValue(const std::string& argument_name,
740 const std::map<std::string, OSArgument>& user_arguments) {

Callers 9

runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
TEST_FFunction · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 7

hasDefaultValueMethod · 0.80
defaultValueAsStringMethod · 0.80
findMethod · 0.45
endMethod · 0.45
hasValueMethod · 0.45
valueAsStringMethod · 0.45
strMethod · 0.45

Tested by 2

runMethod · 0.64
TEST_FFunction · 0.64