We can either implement as the self-contained method, or create a JSON class as a wrapper (as ToJSON() could be also re-used in other classes).
Not sure if we can have multiple hierarchy such as Dict<string, Dict> dict; (depending on the complexity), so for now we can only support the flat list.
Tasks:
[x] Adds Dict's ToString() method to return all elements in the plain format (pass argument to specify delimiter string, e.g. ";" or "\n" for each item).
[x] Adds Dict's ToJSON() method to return all elements in JSON format.
Expand
Dict
class to addToJSON()
method (similar toToString()
). The method should return all elements in the plain JSON format.E.g.
We can either implement as the self-contained method, or create a JSON class as a wrapper (as
ToJSON()
could be also re-used in other classes).Not sure if we can have multiple hierarchy such as
Dict<string, Dict> dict;
(depending on the complexity), so for now we can only support the flat list.Tasks:
ToString()
method to return all elements in the plain format (pass argument to specify delimiter string, e.g. ";" or "\n" for each item).ToJSON()
method to return all elements in JSON format.DictTest.mq5
to cover the test for the new method.