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

Function lexicalCastToInt

src/sdd/Helpers.cpp:56–66  ·  view source on GitHub ↗

Lexical cast the text() of a node as an int

Source from the content-addressed store, hash-verified

54
55 // Lexical cast the text() of a node as an int
56 boost::optional<int> lexicalCastToInt(const pugi::xml_node& element) {
57 boost::optional<int> result;
58 if (element) {
59 try {
60 result = boost::lexical_cast<int>(element.text().as_string());
61 } catch (const boost::bad_lexical_cast&) {
62 // LOG(Error, "Cannot convert element text to double");
63 }
64 }
65 return result;
66 }
67
68 // Lexical cast the text() of an attribute as a double
69 boost::optional<double> lexicalCastToDouble(const pugi::xml_attribute& attr) {

Callers 8

translateVRFSysMethod · 0.85
translateAirSystemMethod · 0.85
translateThermalZoneMethod · 0.85
translateHtRejMethod · 0.85
translateSDDMethod · 0.85
elementByTagNameAndIndexFunction · 0.85
translateLoadsMethod · 0.85

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected