size_t JSString::instanceSize() const { size_t resultSize = 0; UString value = tryGetValue(); if (!value.isNull()) resultSize = value.size() * sizeof(UChar) + value.cost(); // apollo - compile - integrate - 58803 // otherwise, this is a Rope; investigate how to compute size return resultSize; }
Config::Config(const String& fileName) { this->fileName = fileName; AudioEnabled = true; AudioLatencyIndex = 2; VideoZoomIndex = 1; SystemSpeedIndex = 4; try { auto input = File::ReadAllLines(fileName); int value; if (tryGetValue(input, "AudioEnabled", value)) AudioEnabled = value != 0; if (tryGetValue(input, "AudioLatencyIndex", value)) AudioLatencyIndex = value; if (tryGetValue(input, "VideoZoomIndex", value)) VideoZoomIndex = value; if (tryGetValue(input, "SystemSpeedIndex", value)) SystemSpeedIndex = value; } catch (...) { } }
std::ostream& FrameMatchingStatistics::writeElement(std::ostream& str, StatisticElement elem) const { float value; if (tryGetValue(elem, value)) { str << value << tab; } else { str << null << tab; } return str; }