Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::passwd_t Struct Reference

Extends 'struct passwd' and auto allocates necessary memory. Used as a result type with auto memory cleanup. More...

#include <lnx_utils.h>

Inheritance diagram for sf::passwd_t:
[legend]
Collaboration diagram for sf::passwd_t:
[legend]

Public Member Functions

 passwd_t ()
 ~passwd_t ()
 operator bool () const

Friends

bool proc_getpwnam (std::string name, passwd_t &pwd)
bool proc_getpwuid (uid_t uid, passwd_t &pwd)

Detailed Description

Extends 'struct passwd' and auto allocates necessary memory. Used as a result type with auto memory cleanup.

Constructor & Destructor Documentation

◆ passwd_t()

sf::passwd_t::passwd_t ( )

Constructor allocating the right amount of memory.

◆ ~passwd_t()

sf::passwd_t::~passwd_t ( )

Destructor

Member Function Documentation

◆ operator bool()

sf::passwd_t::operator bool ( ) const
inlineexplicit

◆ proc_getpwnam

bool proc_getpwnam ( std::string name,
passwd_t & pwd )
friend

Wrapper for getpwnam_r() but simplified using passwd_t. Returns true when an entry was found. In case of an error, it throws en exception.

◆ proc_getpwuid

bool proc_getpwuid ( uid_t uid,
passwd_t & pwd )
friend

Wrapper for 'getpwuid_r()' but simplified using 'passwd_t'. Returns true when an entry was found. In case of an error, it throws en exception.


The documentation for this struct was generated from the following file: