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 */;
Propriétés
Type | Visibilité | Source | Unité | Parent |
---|---|---|---|---|
function | public | System.JSON.pas System.JSON.hpp |
System.JSON | TJSONValue |
Description
Trouve un objet TJSONValue situé dans le chemin JSON APath
spécifié, transtype cette valeur JSON en tant que type JSON T
et remplit AValue
avec la valeur JSON obtenue. Renvoie True
en cas de réussite ou False
dans le cas contraire.
Dans la version actuelle, TJSONValue implémente la fonctionnalité suivante :
- Si le
APath
spécifié est vide ou s'il n'a pas été spécifié, TryGetValue transtype cette instance TJSONValue en tant que typeT
et remplitAValue
avec la valeur JSON obtenue. TryGetValue renvoieTrue
si le transtypage enT
réussit. - Si un
APath
non vide est spécifié, TryGetValue renvoieFalse
.AValue
n'est pas rempli.