MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / get_global_param_string

Function get_global_param_string

src/CoolProp.cpp:1042–1082  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1040}
1041
1042std::string get_global_param_string(const std::string& ParamName) {
1043 if (ParamName == "version") {
1044 return version;
1045 } else if (ParamName == "gitrevision") {
1046 return gitrevision;
1047 } else if (ParamName == "errstring") {
1048 std::scoped_lock lock(message_mutex);
1049 std::string temp = error_string;
1050 error_string = "";
1051 return temp;
1052 } else if (ParamName == "warnstring") {
1053 std::scoped_lock lock(message_mutex);
1054 std::string temp = warning_string;
1055 warning_string = "";
1056 return temp;
1057 } else if (ParamName == "FluidsList" || ParamName == "fluids_list" || ParamName == "fluidslist") {
1058 return get_fluid_list();
1059 } else if (ParamName == "incompressible_list_pure") {
1060 return get_incompressible_list_pure();
1061 } else if (ParamName == "incompressible_list_solution") {
1062 return get_incompressible_list_solution();
1063 } else if (ParamName == "mixture_binary_pairs_list") {
1064 return get_csv_mixture_binary_pairs();
1065 } else if (ParamName == "parameter_list") {
1066 return get_csv_parameter_list();
1067 } else if (ParamName == "predefined_mixtures") {
1068 return get_csv_predefined_mixtures();
1069 } else if (ParamName == "HOME") {
1070 return get_home_dir();
1071 } else if (ParamName == "REFPROP_version") {
1072 return REFPROPMixtureBackend::version();
1073 } else if (ParamName == "cubic_fluids_schema") {
1074 return std::string{CoolProp::CubicLibrary::get_cubic_fluids_schema()};
1075 } else if (ParamName == "cubic_fluids_list") {
1076 return CoolProp::CubicLibrary::get_cubic_fluids_list();
1077 } else if (ParamName == "pcsaft_fluids_schema") {
1078 return std::string{CoolProp::PCSAFTLibrary::get_pcsaft_fluids_schema()};
1079 } else {
1080 throw ValueError(format("Input parameter [%s] is invalid", ParamName.c_str()));
1081 }
1082};
1083#if defined(ENABLE_CATCH)
1084TEST_CASE("Check inputs to get_global_param_string", "[get_global_param_string]") {
1085 const int num_good_inputs = 8;

Callers 15

COOLPROP_EESFunction · 0.85
CP_Props1SIFunction · 0.85
CP_PropsSIFunction · 0.85
CP_PropsSImultiFunction · 0.85
CP_HAPropsSIFunction · 0.85
cp_get_global_paramFunction · 0.85
calculateFunction · 0.85
PropsSIFunction · 0.85
CoolProp.cppFile · 0.85
Props1SIFunction · 0.85

Calls 11

get_fluid_listFunction · 0.85
get_csv_parameter_listFunction · 0.85
get_home_dirFunction · 0.85
get_cubic_fluids_schemaFunction · 0.85
get_cubic_fluids_listFunction · 0.85
get_pcsaft_fluids_schemaFunction · 0.85
formatFunction · 0.70

Tested by 3

run_checksMethod · 0.68
run_checksMethod · 0.68
run_checksMethod · 0.68