//+------------------------------------------------------------------+ //| Pointer.mq5 | //| Copyright 2026, Niquel Mendoza | //| https://www.mql5.com | //+------------------------------------------------------------------+ #property copyright "Copyright 2026, Niquel Mendoza" #property link "https://www.mql5.com" #property version "1.00" #property strict //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ #include "..\\Src\\JsonNode.mqh" #resource "json_pointer.json" as const string g_json //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- TSN::CJsonParser parser; parser.Assing(g_json); parser.CorrectPadding(); parser.Parse(); TSN::CJsonNode root = parser.GetRoot(); //--- Print("--- CJsonNode ---"); Print(root.Query("/config~1general/riesgo~0maximo").ToDouble(0.0)); Print(root.Query("/raro~1~0mix~0~11").ToString("")); Print(root.Query("/ordenes/2/tags/2").ToString("")); //--- TSN::CDomNodeManager manager; TSN::CDomNodeBase node(&manager); root.ToDom(&node, &manager); //--- CJsonPointerResolver resolver; resolver.Base(&node); Print("--- CJsonPointerResolver ---"); Print(resolver.Query("/config~1general/riesgo~0maximo").ToDouble(0.0)); Print(resolver.Query("/raro~1~0mix~0~11").ToString("")); Print(resolver.Query("/ordenes/2/tags/2").ToString("")); } //+------------------------------------------------------------------+