MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GetInt64Value

Function GetInt64Value

tensorflow/core/platform/cloud/gcs_file_system.cc:256–271  ·  view source on GitHub ↗

Reads a long JSON value with the given name from a parent JSON value.

Source from the content-addressed store, hash-verified

254
255/// Reads a long JSON value with the given name from a parent JSON value.
256Status GetInt64Value(const Json::Value& parent, const char* name,
257 int64* result) {
258 Json::Value result_value;
259 TF_RETURN_IF_ERROR(GetValue(parent, name, &result_value));
260 if (result_value.isNumeric()) {
261 *result = result_value.asInt64();
262 return Status::OK();
263 }
264 if (result_value.isString() &&
265 strings::safe_strto64(result_value.asCString(), result)) {
266 return Status::OK();
267 }
268 return errors::Internal(
269 "The field '", name,
270 "' in the JSON response was expected to be a number.");
271}
272
273/// Reads a boolean JSON value with the given name from a parent JSON value.
274Status GetBoolValue(const Json::Value& parent, const char* name, bool* result) {

Callers 1

UncachedStatForObjectMethod · 0.85

Calls 3

safe_strto64Function · 0.85
InternalFunction · 0.85
GetValueFunction · 0.70

Tested by

no test coverage detected