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

Function stringToInteger

src/utilities/filetypes/EpwFile.cpp:1648–1659  ·  view source on GitHub ↗

Local convenience functions

Source from the content-addressed store, hash-verified

1646
1647// Local convenience functions
1648static int stringToInteger(const std::string& string, bool* ok) {
1649 int value = 0;
1650 *ok = true;
1651 try {
1652 value = std::stoi(string);
1653 } catch (const std::invalid_argument&) {
1654 *ok = false;
1655 } catch (const std::out_of_range&) {
1656 *ok = false;
1657 }
1658 return value;
1659}
1660
1661static double stringToDouble(const std::string& string, bool* ok) {
1662 double value = 0;

Callers 14

setYearMethod · 0.85
setMonthMethod · 0.85
setDayMethod · 0.85
setHourMethod · 0.85
setMinuteMethod · 0.85
setTotalSkyCoverMethod · 0.85
setOpaqueSkyCoverMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected