LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
lldb_private::UserIDResolver Class Referenceabstract

An abstract interface for things that know how to map numeric user/group IDs into names. More...

#include <UserIDResolver.h>

Inheritance diagram for lldb_private::UserIDResolver:
Inheritance graph
[legend]

Public Types

typedef uint32_t id_t
 

Public Member Functions

virtual ~UserIDResolver ()
 
llvm::Optional< llvm::StringRef > GetUserName (id_t uid)
 
llvm::Optional< llvm::StringRef > GetGroupName (id_t gid)
 

Static Public Member Functions

static UserIDResolverGetNoopResolver ()
 Returns a resolver which returns a failure value for each query. More...
 

Protected Member Functions

virtual llvm::Optional< std::string > DoGetUserName (id_t uid)=0
 
virtual llvm::Optional< std::string > DoGetGroupName (id_t gid)=0
 

Detailed Description

An abstract interface for things that know how to map numeric user/group IDs into names.

It caches the resolved names to avoid repeating expensive queries. The cache is internally protected by a mutex, so concurrent queries are safe.

Definition at line 22 of file UserIDResolver.h.

Member Typedef Documentation

◆ id_t

Definition at line 24 of file UserIDResolver.h.

Constructor & Destructor Documentation

◆ ~UserIDResolver()

UserIDResolver::~UserIDResolver ( )
virtualdefault

Member Function Documentation

◆ DoGetGroupName()

virtual llvm::Optional<std::string> lldb_private::UserIDResolver::DoGetGroupName ( id_t  gid)
protectedpure virtual

Referenced by GetGroupName().

◆ DoGetUserName()

virtual llvm::Optional<std::string> lldb_private::UserIDResolver::DoGetUserName ( id_t  uid)
protectedpure virtual

Referenced by GetGroupName(), and GetUserName().

◆ GetGroupName()

llvm::Optional<llvm::StringRef> lldb_private::UserIDResolver::GetGroupName ( id_t  gid)
inline

◆ GetNoopResolver()

UserIDResolver & UserIDResolver::GetNoopResolver ( )
static

Returns a resolver which returns a failure value for each query.

Useful as a fallback value for the case when we know all lookups will fail.

Definition at line 44 of file UserIDResolver.cpp.

References g_noop_resolver.

Referenced by GetGroupName(), and lldb_private::RemoteAwarePlatform::GetUserIDResolver().

◆ GetUserName()

llvm::Optional<llvm::StringRef> lldb_private::UserIDResolver::GetUserName ( id_t  uid)
inline

The documentation for this class was generated from the following files: