From 70c1cdfd8f34472761fe5ec97f0713990c1b4f5b Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 5 Sep 2018 21:23:41 +0300 Subject: Add multi-tenancy support --- mod/utility.hxx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 mod/utility.hxx (limited to 'mod/utility.hxx') diff --git a/mod/utility.hxx b/mod/utility.hxx new file mode 100644 index 0000000..2ce1e07 --- /dev/null +++ b/mod/utility.hxx @@ -0,0 +1,25 @@ +// file : mod/utility.hxx -*- C++ -*- +// copyright : Copyright (c) 2014-2018 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef MOD_UTILITY_HXX +#define MOD_UTILITY_HXX + +#include +#include + +namespace brep +{ + // Append the @ leaf component to the directory if the tenant is + // not empty. Otherwise, return the directory unchanged. + // + inline dir_path + tenant_dir (const dir_path& dir, const string& tenant) + { + return !tenant.empty () + ? path_cast (dir / ('@' + tenant)) + : dir; + } +} + +#endif // MOD_UTILITY_HXX -- cgit v1.1