System.JSON.TJSONValue.TryGetValue
Delphi
function TryGetValue<T>(out AValue: T): Boolean; overload;
function TryGetValue<T>(const APath: string; out AValue: T): Boolean; overload;
C++
template<typename T> bool __fastcall TryGetValue(/* out */ T &AValue)/* overload */;
template<typename T> bool __fastcall TryGetValue(const System::UnicodeString APath, /* out */ T &AValue)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONValue |
Description
Finds a TJSONValue object located at the specified APath
JSON path, casts this JSON value as the T
JSON type and fills AValue
with the obtained JSON value. Returns True
on success or False
otherwise.
In the current version, TJSONValue implements the following functionality:
- If the specified
APath
is empty or it is not specified, TryGetValue casts this TJSONValue instance as theT
type and fillsAValue
with the obtained JSON value. TryGetValue returnsTrue
if cast toT
succeed. - If not empty
APath
is specified, then TryGetValue returnsFalse
.AValue
is not filled.