ShemaJson/Src/Def.mqh

73 lines
2.3 KiB
MQL5
Raw Permalink Normal View History

2026-06-22 16:51:02 -05:00
//+------------------------------------------------------------------+
//| Def.mqh |
//| Copyright 2026, Niquel Mendoza. |
//| https://www.mql5.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza."
#property link "https://www.mql5.com/"
#property strict
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "..\\..\\JsonParserByLeo\\Src\\JsonNode.mqh"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
namespace TSN
{
// Convierte "object" al tipo valido.. que pide T
typedef int (*JsonShemaFuncStrToType)(const string& shema_type);
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#define JSONSHEMA_NUMBER_MIN 0
#define JSONSHEMA_NUMBER_MAX 1
#define JSONSHEMA_NUMBER_EX_MIN 2
#define JSONSHEMA_NUMBER_EX_MAX 3
#define JSONSHEMA_NUMBER_MULTIPLE 4
#define JSONSHEMA_NUMBER_ENUM 5
//---
#define JSONSHEMA_STR_MIN_LEN 0
#define JSONSHEMA_STR_MAX_LEN 1
#define JSONSHEMA_STR_PATTERN 2
#define JSONSHEMA_STR_FORMAT 3
//---
#define JSONSHEMA_STR_ENUM 4
/*
{
"type": "object", capa 1: el documento entero
"required": [...],
"properties": {
"config": {
"type" : "object"
}
"valor" : {
"type" : "int"
}
}
}
}
-----
{
"config" : {},
"valor": 20
}
*/
2026-06-28 07:58:04 -05:00
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#define TSN_JSON_SHEMA_NEXT_EL 8
#define TSN_JSON_SHEMA_POP 9
2026-06-22 16:51:02 -05:00
}
//+------------------------------------------------------------------+