From ceb192604006c85bc069653152b8b879396a1e94 Mon Sep 17 00:00:00 2001 From: 3lswear Date: Sat, 8 Jan 2022 00:04:06 +0300 Subject: [PATCH] feat: add toString for array --- src/config/TOMLNode.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/config/TOMLNode.hpp b/src/config/TOMLNode.hpp index 0273ac7..2d976cb 100644 --- a/src/config/TOMLNode.hpp +++ b/src/config/TOMLNode.hpp @@ -92,6 +92,18 @@ class toml_node ss >> *result; return (result); } + case ARRAY: + { + TOMLArray::iterator it; + std::string *result = new std::string("[ "); + for (it = value.array->begin(); it != value.array->end(); ++it) + { + *result += *((*it)->toString()); + *result += ", "; + } + *result += " ]"; + return (result); + } default: return ( new std::string("Not implemented :)")); }