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
APathis empty or it is not specified, TryGetValue casts this TJSONValue instance as theTtype and fillsAValuewith the obtained JSON value. TryGetValue returnsTrueif cast toTsucceed. - If not empty
APathis specified, then TryGetValue returnsFalse.AValueis not filled.