MCPcopy Create free account
hub / github.com/colmap/colmap / GetEnvInt

Function GetEnvInt

src/colmap/util/file.cc:340–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338 1; // linear backoff: 1s, 2s, ...
339
340int GetEnvInt(const char* name, int default_value) {
341 const std::optional<std::string> val = GetEnvSafe(name);
342 if (val.has_value() && !val->empty()) {
343 try {
344 return std::stoi(*val);
345 } catch (const std::exception&) {
346 LOG(WARNING) << "Invalid value for " << name << ": " << *val
347 << ". Using default: " << default_value;
348 }
349 }
350 return default_value;
351}
352
353std::optional<std::string> DownloadFile(const std::string& url) {
354 VLOG(2) << "Downloading file from: " << url;

Callers 1

DownloadFileFunction · 0.85

Calls 2

GetEnvSafeFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected