MySQL 9.1.0
Source Code Documentation
KeyringFrontend Class Reference

passwd file management frontend. More...

#include <keyring_frontend.h>

Classes

struct  Config
 

Public Types

enum class  Cmd {
  Init , Set , Get , Delete ,
  List , Export , MasterDelete , MasterList ,
  MasterRename , ShowHelp , ShowVersion
}
 

Public Member Functions

 KeyringFrontend (const std::string &exe_name, const std::vector< std::string > &args, std::istream &is=std::cin, 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 ()
 
void prepare_args ()
 prepare arguments and cmds. More...
 
std::string read_password ()
 

Private Attributes

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

Detailed Description

passwd file management frontend.

Member Enumeration Documentation

◆ Cmd

enum class KeyringFrontend::Cmd
strong
Enumerator
Init 
Set 
Get 
Delete 
List 
Export 
MasterDelete 
MasterList 
MasterRename 
ShowHelp 
ShowVersion 

Constructor & Destructor Documentation

◆ KeyringFrontend()

KeyringFrontend::KeyringFrontend ( const std::string &  exe_name,
const std::vector< std::string > &  args,
std::istream &  is = std::cin,
std::ostream &  os = std::cout,
std::ostream &  es = std::cerr 
)

Member Function Documentation

◆ get_help()

std::string KeyringFrontend::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 KeyringFrontend::get_version ( )
staticnoexcept

get version text.

◆ init_from_arguments()

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

◆ prepare_args()

void KeyringFrontend::prepare_args ( )
private

prepare arguments and cmds.

  • check command name
  • check argument counts
Exceptions
UsageErroron error

◆ prepare_command_options()

void KeyringFrontend::prepare_command_options ( )
private

◆ read_password()

std::string KeyringFrontend::read_password ( )
private

◆ run()

int KeyringFrontend::run ( )

run frontend according to configuration.

Returns
exit-status
Return values
EXIT_FAILUREon error
EXIT_SUCCESSon success

Member Data Documentation

◆ arg_handler_

CmdArgHandler KeyringFrontend::arg_handler_ {true}
private

◆ cerr_

std::ostream& KeyringFrontend::cerr_
private

◆ cin_

std::istream& KeyringFrontend::cin_
private

◆ config_

Config KeyringFrontend::config_
private

◆ cout_

std::ostream& KeyringFrontend::cout_
private

◆ program_name_

std::string KeyringFrontend::program_name_
private

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