diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2018-09-05 21:23:41 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2018-09-08 17:44:57 +0300 |
commit | 70c1cdfd8f34472761fe5ec97f0713990c1b4f5b (patch) | |
tree | f2e631c10563bcc0cde07e4359c11b800a188d86 /mod/utility.hxx | |
parent | 3be834183ae36c321e4b560dce9a63cee846e63d (diff) |
Add multi-tenancy support
Diffstat (limited to 'mod/utility.hxx')
-rw-r--r-- | mod/utility.hxx | 25 |
1 files changed, 25 insertions, 0 deletions
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 <libbrep/types.hxx> +#include <libbrep/utility.hxx> + +namespace brep +{ + // Append the @<tenant> 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_path> (dir / ('@' + tenant)) + : dir; + } +} + +#endif // MOD_UTILITY_HXX |