NCBI C++ ToolKit
Static Public Member Functions | List of all members
CUnixFeature Class Reference

Search Toolkit Book for CUnixFeature

CUnixFeature –. More...

#include "ncbi_os_unix_p.hpp"
(Private to src/corelib.)

Static Public Member Functions

static string GetUserNameByUID (uid_t uid)
 Look up user name by given numeric user ID. More...
 
static uid_t GetUserUIDByName (const string &user)
 Look up numeric user ID by symbolic user name. More...
 
static string GetGroupNameByGID (gid_t gid)
 Look up group name by given numeric group ID. More...
 
static gid_t GetGroupGIDByName (const string &group)
 Look up numeric group ID by symbolic group name. More...
 

Detailed Description

CUnixFeature –.

Utility class with wrappers for UNIX features.

Definition at line 63 of file ncbi_os_unix_p.hpp.

Member Function Documentation

◆ GetGroupGIDByName()

gid_t CUnixFeature::GetGroupGIDByName ( const string group)
static

Look up numeric group ID by symbolic group name.

Parameters
groupGroup name whose ID is looked up
Returns
Numeric group ID when succeeded, or (gid_t)(-1) when failed

Definition at line 329 of file ncbi_os_unix.cpp.

References _ASSERT, buf, Critical(), ERR_POST_ONCE, Error(), GRP_BUF, MAX_TRY, n, NCBI_AS_STRING, NStr::NumericToString(), and ncbi::grid::netcache::search::fields::size.

Referenced by CDirEntry::SetOwner().

◆ GetGroupNameByGID()

string CUnixFeature::GetGroupNameByGID ( gid_t  gid)
static

Look up group name by given numeric group ID.

Parameters
gidNumeric group ID
Returns
Non-empty string on success, empty string on error

Definition at line 238 of file ncbi_os_unix.cpp.

References _ASSERT, buf, Critical(), ERR_POST_ONCE, Error(), GRP_BUF, MAX_TRY, n, NCBI_AS_STRING, NStr::NumericToString(), and ncbi::grid::netcache::search::fields::size.

Referenced by CDirEntry::GetOwner(), and CTar::x_Append().

◆ GetUserNameByUID()

string CUnixFeature::GetUserNameByUID ( uid_t  uid)
static

Look up user name by given numeric user ID.

Parameters
userNumeric user ID
Returns
Non-empty string on success, empty string on error

Definition at line 57 of file ncbi_os_unix.cpp.

References _ASSERT, buf, Critical(), ERR_POST_ONCE, Error(), MAX_TRY, n, NCBI_AS_STRING, NStr::NumericToString(), PWD_BUF, and ncbi::grid::netcache::search::fields::size.

Referenced by CDirEntry::GetOwner(), CSystemInfo::GetUserName(), and CTar::x_Append().

◆ GetUserUIDByName()

uid_t CUnixFeature::GetUserUIDByName ( const string user)
static

Look up numeric user ID by symbolic user name.

Parameters
userUser name whose ID is looked up
Returns
Numeric user ID when succeeded, or (uid_t)(-1) when failed

Definition at line 147 of file ncbi_os_unix.cpp.

References _ASSERT, buf, Critical(), ERR_POST_ONCE, Error(), MAX_TRY, n, NCBI_AS_STRING, NStr::NumericToString(), PWD_BUF, and ncbi::grid::netcache::search::fields::size.

Referenced by CDirEntry::SetOwner().


The documentation for this class was generated from the following files:
Modified on Tue Feb 27 05:54:52 2024 by modify_doxy.py rev. 669887