summaryrefslogtreecommitdiff
path: root/netfs/entCache.h
diff options
context:
space:
mode:
Diffstat (limited to 'netfs/entCache.h')
-rw-r--r--netfs/entCache.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/netfs/entCache.h b/netfs/entCache.h
new file mode 100644
index 0000000..fc8ab08
--- /dev/null
+++ b/netfs/entCache.h
@@ -0,0 +1,29 @@
+#ifndef ENTCACHE_H
+#define ENTCACHE_H
+
+#include <pwd.h>
+#include <grp.h>
+#include <string>
+#include <boost/bimap.hpp>
+
+class EntCache {
+ public:
+ EntCache();
+ virtual ~EntCache();
+
+ uid_t getUID(const std::string & ) const;
+ gid_t getGID(const std::string & ) const;
+ const std::string & getUName(uid_t) const;
+ const std::string & getGName(gid_t) const;
+
+ private:
+ void makeuidCache() const;
+ void makegidCache() const;
+ typedef boost::bimap<uid_t, std::string> UIDs;
+ typedef boost::bimap<gid_t, std::string> GIDs;
+ mutable UIDs uidcache;
+ mutable GIDs gidcache;
+};
+
+#endif
+