From 09aa968ed040bd9d9b60df23e8a15889518ce942 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 12 Apr 2025 19:44:40 -0400 Subject: [PATCH] cmFileAPI: Add BuildReplyEntry wrapper around AddReplyIndexObject --- Source/cmFileAPI.cxx | 9 +++++++-- Source/cmFileAPI.h | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Source/cmFileAPI.cxx b/Source/cmFileAPI.cxx index 46d610cb9a..3ce8749d17 100644 --- a/Source/cmFileAPI.cxx +++ b/Source/cmFileAPI.cxx @@ -442,7 +442,7 @@ Json::Value cmFileAPI::BuildReply(Query const& q) Json::Value reply = Json::objectValue; for (Object const& o : q.Known) { std::string const& name = ObjectName(o); - reply[name] = this->AddReplyIndexObject(o); + reply[name] = this->BuildReplyEntry(o); } for (std::string const& name : q.Unknown) { @@ -451,6 +451,11 @@ Json::Value cmFileAPI::BuildReply(Query const& q) return reply; } +Json::Value cmFileAPI::BuildReplyEntry(Object const& object) +{ + return this->AddReplyIndexObject(object); +} + Json::Value cmFileAPI::BuildReplyError(std::string const& error) { Json::Value e = Json::objectValue; @@ -681,7 +686,7 @@ Json::Value cmFileAPI::BuildClientReplyResponse(ClientRequest const& request) response = this->BuildReplyError(request.Error); return response; } - response = this->AddReplyIndexObject(request); + response = this->BuildReplyEntry(request); return response; } diff --git a/Source/cmFileAPI.h b/Source/cmFileAPI.h index 79fc5ada5f..8cdf828135 100644 --- a/Source/cmFileAPI.h +++ b/Source/cmFileAPI.h @@ -177,6 +177,7 @@ private: Json::Value BuildReplyIndex(); Json::Value BuildCMake(); Json::Value BuildReply(Query const& q); + Json::Value BuildReplyEntry(Object const& object); static Json::Value BuildReplyError(std::string const& error); Json::Value const& AddReplyIndexObject(Object const& o);