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

Method parseRunOptions

src/utilities/filetypes/WorkflowJSON.cpp:906–930  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

904 }
905
906 void WorkflowJSON_Impl::parseRunOptions() {
907 if (m_runOptions) {
908 disconnectRunOptions();
909 m_runOptions.reset();
910 }
911
912 if (m_value.isMember("run_options")) {
913 Json::Value options = m_value["run_options"];
914
915 Json::StreamWriterBuilder wbuilder;
916 // mimic the old FastWriter behavior:
917 wbuilder["commentStyle"] = "None";
918 wbuilder["indentation"] = "";
919
920 std::string s = Json::writeString(wbuilder, options);
921
922 m_runOptions = RunOptions::fromString(s);
923 if (!m_runOptions) {
924 LOG_AND_THROW("Run options cannot be processed");
925 }
926
927 connectRunOptions();
928 m_value.removeMember("run_options");
929 }
930 }
931
932 void WorkflowJSON_Impl::disconnectRunOptions() {
933 if (m_runOptions) {

Callers

nothing calls this directly

Calls 2

isMemberMethod · 0.80
resetMethod · 0.45

Tested by

no test coverage detected