Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.196 Beiträge
 
Delphi 12 Athens
 
#3

AW: JSON mit Punkt im Namen

  Alt 5. Apr 2023, 11:20


Delphi-Quellcode:
  /// <summary> Parses a JSON path with names and indexes.</summary>
  /// <remarks>
  /// The syntax to write paths is similar to XPath but in a Json way.
  /// The following XPath expression:
  /// /entities/urls[0]/indices[1]
  /// would look like
  /// entities.urls[0].indices[1] (dot notation)
  /// or
  /// entities["urls"][0]["indices"][1] (bracket notation)
  ///
  /// The dot (.) token is used to access the object elements:
  /// ex: object.key
  ///
  /// The bracket ([]) token is used to access array or object elements:
  /// In array: cities[0]
  /// In object: city["name"] or city['name']
  /// In object: ["city"]["name"] or ['city']['name']
  ///
  /// The quote (" or ') is used to introduce a literal when the element is being written in bracket notation:
  /// ex:["first"]["second"] or ['first']['second']
  ///
  /// To escape the quote in a literal use backslash (\): \"
  /// ex: ["quotes(\").should.be.escaped"] or ['quotes(\').should.be.escaped']
  ///
  /// Note: The backslash will only escape quotes within a literal. Bracket notation can be useful when
  /// names can not be written in dot notation, like the objects keys with dot characters:
  /// ex: object["key.with.dots"] or object['key.with.dots']
  ///
  /// </remarks>
  TJSONPathParser = record
Zitat:
Note: The backslash will only escape quotes within a literal. Bracket notation can be useful when
names can not be written in dot notation, like the objects keys with dot characters
:
ex: object["key.with.dots"] or object['key.with.dots']
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat