From ee08b3e8804074c73245ca24c3663e43158eb790 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 23 Feb 2025 00:07:05 +0000 Subject: Rename RPC::Block to RPC::Map. --- include/modules/rpc.h | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'include/modules') diff --git a/include/modules/rpc.h b/include/modules/rpc.h index ca23a0286..c9f9200a7 100644 --- a/include/modules/rpc.h +++ b/include/modules/rpc.h @@ -14,13 +14,13 @@ namespace RPC { - class Block; class Event; + class Map; class Request; class ServiceInterface; /** Represents possible types of RPC value. */ - using Value = std::variant; + using Value = std::variant; /** Represents standard RPC errors from the JSON-RPC and XML-RPC specifications. */ enum Error @@ -35,50 +35,50 @@ namespace RPC }; } -class RPC::Block +class RPC::Map { public: /** Retrieves the list of RPC replies. */ inline const auto &GetReplies() const { return this->replies; } template - inline Block &Reply(const Anope::string &key, const Stringable &value) + inline Map &Reply(const Anope::string &key, const Stringable &value) { this->replies.emplace(key, Anope::ToString(value)); return *this; } - inline Block &ReplyBlock(const Anope::string &key) + inline Map &ReplyMap(const Anope::string &key) { - auto it = this->replies.emplace(key, Block()); - return std::get(it.first->second); + auto it = this->replies.emplace(key, Map()); + return std::get(it.first->second); } - inline Block &ReplyBool(const Anope::string &key, bool value) + inline Map &ReplyBool(const Anope::string &key, bool value) { this->replies.emplace(key, value); return *this; } - inline Block &ReplyFloat(const Anope::string &key, double value) + inline Map &ReplyFloat(const Anope::string &key, double value) { this->replies.emplace(key, value); return *this; } - inline Block &ReplyInt(const Anope::string &key, int64_t value) + inline Map &ReplyInt(const Anope::string &key, int64_t value) { this->replies.emplace(key, value); return *this; } - inline Block &ReplyNull(const Anope::string &key) + inline Map &ReplyNull(const Anope::string &key) { this->replies.emplace(key, nullptr); return *this; } - inline Block &ReplyUInt(const Anope::string &key, uint64_t value) + inline Map &ReplyUInt(const Anope::string &key, uint64_t value) { this->replies.emplace(key, value); return *this; @@ -89,7 +89,7 @@ private: }; class RPC::Request final - : public RPC::Block + : public RPC::Map { private: std::optional> error; -- cgit