From fe6f09d218f6098fd3f9ddca15db5c95f21ead58 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 23 Mar 2018 20:31:09 -0700 Subject: [PATCH] ircd::mods: Preliminary ADL wrappage of mods::mod. --- include/ircd/mods.h | 3 +++ ircd/mods.cc | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/ircd/mods.h b/include/ircd/mods.h index 7e30aa384..a82b8f201 100644 --- a/include/ircd/mods.h +++ b/include/ircd/mods.h @@ -53,6 +53,9 @@ namespace ircd::mods std::forward_list available(); bool available(const std::string &name); bool loaded(const std::string &name); + + string_view name(const mod &); + string_view path(const mod &); } // Bring struct module into main ircd:: diff --git a/ircd/mods.cc b/ircd/mods.cc index b0777d929..8980f3d9e 100644 --- a/ircd/mods.cc +++ b/ircd/mods.cc @@ -38,8 +38,30 @@ std::map ircd::mods::mod::loaded {}; +/////////////////////////////////////////////////////////////////////////////// // -// mod (internal) +// mods/mods.h +// + +ircd::string_view +ircd::mods::name(const mod &mod) +{ + return mod.name(); +} + +ircd::string_view +ircd::mods::path(const mod &mod) +{ + return mod.location(); +} + +/////////////////////////////////////////////////////////////////////////////// +// +// (internal) mods.h +// + +// +// mod::mod // ircd::mods::mod::mod(const filesystem::path &path,