Electroneum
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
tools::login Struct Reference

#include <password.h>

Collaboration diagram for tools::login:
Collaboration graph
[legend]

Public Member Functions

 login ()=default
 
 login (const login &)=delete
 
 login (login &&)=default
 
 ~login ()=default
 
loginoperator= (const login &)=delete
 
loginoperator= (login &&)=default
 

Static Public Member Functions

static boost::optional< loginparse (std::string &&userpass, bool verify, const std::function< boost::optional< password_container >(bool)> &prompt)
 

Public Attributes

std::string username
 
password_container password
 

Constructor & Destructor Documentation

◆ login() [1/3]

tools::login::login ( )
default

◆ login() [2/3]

tools::login::login ( const login )
delete

◆ login() [3/3]

tools::login::login ( login &&  )
default

◆ ~login()

tools::login::~login ( )
default

Member Function Documentation

◆ operator=() [1/2]

login& tools::login::operator= ( const login )
delete

◆ operator=() [2/2]

login& tools::login::operator= ( login &&  )
default

◆ parse()

boost::optional< login > tools::login::parse ( std::string &&  userpass,
bool  verify,
const std::function< boost::optional< password_container >(bool)> &  prompt 
)
static

Extracts username and password from the format username:password. A blank username or password is allowed. If the : character is not present, password_container::prompt will be called by forwarding the verify and message arguments.

Parameters
userpassIs "consumed", and the memory contents are wiped.
verifyis passed to password_container::prompt if necessary.
messageis passed to password_container::prompt if necessary.
Returns
The username and password, or boost::none if password_container::prompt fails.

Member Data Documentation

◆ password

password_container tools::login::password

◆ username

std::string tools::login::username

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