MySQL 9.1.0
Source Code Documentation
PasswdFrontend Class Reference

passwd file management frontend. More...

#include <passwd.h>

Classes

struct  Config
 

Public Types

enum class  Kdf { Sha256_crypt , Sha512_crypt , Pbkdf2_sha256 , Pbkdf2_sha512 }
 
enum class  Cmd {
  Set , Delete , Verify , List ,
  ShowHelp , ShowVersion
}
 

Public Member Functions

 PasswdFrontend (const std::string &exe_name, const std::vector< std::string > &args, std::ostream &os=std::cout, std::ostream &es=std::cerr)
 
int run ()
 run frontend according to configuration. More...
 
std::string get_help (const size_t screen_width=80) const
 get help text. More...
 

Static Public Member Functions

static std::string get_version () noexcept
 get version text. More...
 

Private Member Functions

void init_from_arguments (const std::vector< std::string > &arguments)
 
void prepare_command_options ()
 
std::string read_password ()
 

Private Attributes

std::string program_name_
 
CmdArgHandler arg_handler_ {true}
 
std::ostream & cout_
 
std::ostream & cerr_
 
Config config_
 

Detailed Description

passwd file management frontend.

Member Enumeration Documentation

◆ Cmd

enum class PasswdFrontend::Cmd
strong
Enumerator
Set 
Delete 
Verify 
List 
ShowHelp 
ShowVersion 

◆ Kdf

enum class PasswdFrontend::Kdf
strong
Enumerator
Sha256_crypt 
Sha512_crypt 
Pbkdf2_sha256 
Pbkdf2_sha512 

Constructor & Destructor Documentation

◆ PasswdFrontend()

PasswdFrontend::PasswdFrontend ( const std::string &  exe_name,
const std::vector< std::string > &  args,
std::ostream &  os = std::cout,
std::ostream &  es = std::cerr 
)

Member Function Documentation

◆ get_help()

std::string PasswdFrontend::get_help ( const size_t  screen_width = 80) const

get help text.

Parameters
screen_widthwraps text at screen-width
Returns
help text

◆ get_version()

std::string PasswdFrontend::get_version ( )
staticnoexcept

get version text.

◆ init_from_arguments()

void PasswdFrontend::init_from_arguments ( const std::vector< std::string > &  arguments)
private

◆ prepare_command_options()

void PasswdFrontend::prepare_command_options ( )
private

◆ read_password()

std::string PasswdFrontend::read_password ( )
private

◆ run()

int PasswdFrontend::run ( )

run frontend according to configuration.

Returns
exit-status
Return values
EXIT_FAILUREon error
EXIT_SUCCESSon success

Member Data Documentation

◆ arg_handler_

CmdArgHandler PasswdFrontend::arg_handler_ {true}
private

◆ cerr_

std::ostream& PasswdFrontend::cerr_
private

◆ config_

Config PasswdFrontend::config_
private

◆ cout_

std::ostream& PasswdFrontend::cout_
private

◆ program_name_

std::string PasswdFrontend::program_name_
private

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