| //+------------------------------------------------------------------+
|
| //| ConvArr.mqh |
|
| //| Copyright 2026, Niquel Mendoza. |
|
| //| https://www.mql5.com |
|
| //+------------------------------------------------------------------+
|
| #property copyright "Copyright 2026, Niquel Mendoza."
|
| #property link "https://www.mql5.com"
|
| #property strict
|
|
|
| #ifndef TSNSTD_SRC_STRING_CONV_CONVARR_MQH
|
| #define TSNSTD_SRC_STRING_CONV_CONVARR_MQH
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| #include "FromStr.mqh"
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| namespace TSN
|
| {
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| class CStringConvert
|
| {
|
| public:
|
| CStringConvert(void) {}
|
| ~CStringConvert(void) {}
|
|
|
| //--- signed
|
| static __forceinline void ToValue(const string& str, int& pos, short& v, const int s_len);
|
| static __forceinline void ToValue(const string& str, int& pos, int& v, const int s_len);
|
| static __forceinline void ToValue(const string& str, int& pos, long& v, const int s_len);
|
|
|
| //--- ungisend
|
| static __forceinline void ToValue(const string& str, int& pos, uchar& v, const int s_len);
|
| static __forceinline void ToValue(const string& str, int& pos, ushort& v, const int s_len);
|
| static __forceinline void ToValue(const string& str, int& pos, uint& v, const int s_len);
|
| static __forceinline void ToValue(const string& str, int& pos, ulong& v, const int s_len);
|
|
|
| //--- double
|
| static __forceinline void ToValue(const string& str, int& pos, double& v, const int s_len);
|
| };
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, uchar &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<uchar, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, ushort &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<ushort, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, uint &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<uint, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, ulong &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<ulong, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, short &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNSigned<short, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, int &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<int, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, long &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToValueNUnsigned<long, TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
|
|
| //+------------------------------------------------------------------+
|
| //| |
|
| //+------------------------------------------------------------------+
|
| static __forceinline void CStringConvert::ToValue(const string &str, int &pos, double &v, const int s_len)
|
| {
|
| CTsnStrBasicNumConv::ToDbl<TSNSTD_STRCONV_WERR_TYPE>(str, pos, v, s_len);
|
| }
|
|
|
| //---
|
| }
|
|
|
| #endif // TSNSTD_SRC_STRING_CONV_CONVARR_MQH
|