9#ifndef LLDB_UTILITY_USERIDRESOLVER_H
10#define LLDB_UTILITY_USERIDRESOLVER_H
12#include "llvm/ADT/DenseMap.h"
13#include "llvm/ADT/StringRef.h"
44 using Map = llvm::DenseMap<id_t, std::optional<std::string>>;
46 std::optional<llvm::StringRef>
An abstract interface for things that know how to map numeric user/group IDs into names.
std::optional< llvm::StringRef > GetGroupName(id_t gid)
virtual ~UserIDResolver()
virtual std::optional< std::string > DoGetGroupName(id_t gid)=0
static UserIDResolver & GetNoopResolver()
Returns a resolver which returns a failure value for each query.
virtual std::optional< std::string > DoGetUserName(id_t uid)=0
llvm::DenseMap< id_t, std::optional< std::string > > Map
std::optional< llvm::StringRef > GetUserName(id_t uid)
std::optional< llvm::StringRef > Get(id_t id, Map &cache, std::optional< std::string >(UserIDResolver::*do_get)(id_t))
A class that represents a running process on the host machine.