MCPcopy Create free account
hub / github.com/apple/foundationdb / extractIntOption

Function extractIntOption

fdbclient/NativeAPI.actor.cpp:2012–2024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2010}
2011
2012int64_t extractIntOption(Optional<StringRef> value, int64_t minValue, int64_t maxValue) {
2013 validateOptionValuePresent(value);
2014 if (value.get().size() != 8) {
2015 throw invalid_option_value();
2016 }
2017
2018 int64_t passed = *((int64_t*)(value.get().begin()));
2019 if (passed > maxValue || passed < minValue) {
2020 throw invalid_option_value();
2021 }
2022
2023 return passed;
2024}
2025
2026uint64_t extractHexOption(StringRef value) {
2027 char* end;

Callers 3

setOptionMethod · 0.70
setNetworkOptionFunction · 0.70
setOptionImplMethod · 0.70

Calls 4

getMethod · 0.65
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected