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
APathspécifié est vide ou s'il n'a pas été spécifié, TryGetValue transtype cette instance TJSONValue en tant que typeTet remplitAValueavec la valeur JSON obtenue. TryGetValue renvoieTruesi le transtypage enTréussit. - Si un
APathnon vide est spécifié, TryGetValue renvoieFalse.AValuen'est pas rempli.