From 20a1f261271671c463256b07c91c37279eb8d25b Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Thu, 24 Apr 2025 13:10:14 +0200 Subject: [PATCH] cmConfigureLog: support writing array values --- Source/cmConfigureLog.cxx | 20 ++++++++++++++++++++ Source/cmConfigureLog.h | 4 ++++ 2 files changed, 24 insertions(+) diff --git a/Source/cmConfigureLog.cxx b/Source/cmConfigureLog.cxx index a7ada175a1..b486cc3df3 100644 --- a/Source/cmConfigureLog.cxx +++ b/Source/cmConfigureLog.cxx @@ -123,6 +123,26 @@ void cmConfigureLog::EndLine() this->Stream << std::endl; } +void cmConfigureLog::BeginArray() +{ + ++this->Indent; +} + +void cmConfigureLog::NextArrayElement() +{ + assert(this->Indent); + --this->Indent; + this->BeginLine() << '-'; + this->EndLine(); + ++this->Indent; +} + +void cmConfigureLog::EndArray() +{ + assert(this->Indent); + --this->Indent; +} + void cmConfigureLog::BeginObject(cm::string_view key) { this->BeginLine() << key << ':'; diff --git a/Source/cmConfigureLog.h b/Source/cmConfigureLog.h index ff9b4ee7a9..6c6c44f40f 100644 --- a/Source/cmConfigureLog.h +++ b/Source/cmConfigureLog.h @@ -34,6 +34,10 @@ public: void BeginEvent(std::string const& kind, cmMakefile const& mf); void EndEvent(); + void BeginArray(); + void NextArrayElement(); + void EndArray(); + void BeginObject(cm::string_view key); void EndObject();