diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-16 00:44:34 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2020-09-16 00:44:34 +0100 |
commit | 98f5f9e905c050f2f934fdcdac8c2bc1899cf5b3 (patch) | |
tree | 669f89770670a516e16ee3987cd926c353d80319 | |
parent | Concrete entcache types (diff) | |
download | netfs-98f5f9e905c050f2f934fdcdac8c2bc1899cf5b3.tar.bz2 netfs-98f5f9e905c050f2f934fdcdac8c2bc1899cf5b3.tar.xz netfs-98f5f9e905c050f2f934fdcdac8c2bc1899cf5b3.zip |
Progressive constructors for mappers
-rw-r--r-- | netfs/fuse/fuseMappersImpl.cpp | 6 | ||||
-rw-r--r-- | netfs/fuse/fuseMappersImpl.h | 1 | ||||
-rw-r--r-- | netfs/lib/defaultMapper.cpp | 6 | ||||
-rw-r--r-- | netfs/lib/defaultMapper.h | 1 |
4 files changed, 10 insertions, 4 deletions
diff --git a/netfs/fuse/fuseMappersImpl.cpp b/netfs/fuse/fuseMappersImpl.cpp index 9e82b74..87266b1 100644 --- a/netfs/fuse/fuseMappersImpl.cpp +++ b/netfs/fuse/fuseMappersImpl.cpp @@ -2,8 +2,10 @@ #include <entCache.h> namespace NetFS::Client { - HideUnknownMapperImpl::HideUnknownMapperImpl() : - users(std::make_shared<UserEntCache>()), groups(std::make_shared<GroupEntCache>(users)) + HideUnknownMapperImpl::HideUnknownMapperImpl() : HideUnknownMapperImpl(std::make_shared<UserEntCache>()) { } + + HideUnknownMapperImpl::HideUnknownMapperImpl(EntryResolverPtr<User> u) : + HideUnknownMapperImpl(std::move(u), std::make_shared<GroupEntCache>(u)) { } diff --git a/netfs/fuse/fuseMappersImpl.h b/netfs/fuse/fuseMappersImpl.h index 4b0677f..b8e87f4 100644 --- a/netfs/fuse/fuseMappersImpl.h +++ b/netfs/fuse/fuseMappersImpl.h @@ -10,6 +10,7 @@ namespace NetFS { class HideUnknownMapperImpl : public HideUnknownMapper { public: HideUnknownMapperImpl(); + HideUnknownMapperImpl(EntryResolverPtr<User> u); HideUnknownMapperImpl(EntryResolverPtr<User> u, EntryResolverPtr<Group> g); Mapping::Transport mapFileSystem(int uid, int gid) override; diff --git a/netfs/lib/defaultMapper.cpp b/netfs/lib/defaultMapper.cpp index 865cca1..d20f7ba 100644 --- a/netfs/lib/defaultMapper.cpp +++ b/netfs/lib/defaultMapper.cpp @@ -3,8 +3,10 @@ #include <exceptions.h> namespace NetFS::Mapping { - DefaultMapper::DefaultMapper() : - users(std::make_shared<UserEntCache>()), groups(std::make_shared<GroupEntCache>(users)) + DefaultMapper::DefaultMapper() : DefaultMapper(std::make_shared<UserEntCache>()) { } + + DefaultMapper::DefaultMapper(EntryResolverPtr<User> u) : + DefaultMapper(std::move(u), std::make_shared<GroupEntCache>(u)) { } diff --git a/netfs/lib/defaultMapper.h b/netfs/lib/defaultMapper.h index 214f9ed..5a5c335 100644 --- a/netfs/lib/defaultMapper.h +++ b/netfs/lib/defaultMapper.h @@ -10,6 +10,7 @@ namespace NetFS { class DefaultMapper : public Mapper { public: DefaultMapper(); + DefaultMapper(EntryResolverPtr<User> users); DefaultMapper(EntryResolverPtr<User> users, EntryResolverPtr<Group> groups); Transport mapFileSystem(int uid, int gid) override; |