PasswordString Class Reference

List of all members.

Public Member Functions

 PasswordString (int inKnownLength=0, const SmartUtil::tstring &inString=_T(""))
 Constructor that can specify a known length and an initial value.
 ~PasswordString ()
 Destructor attempts to remove the password characters from memory.

Detailed Description

A password string should not be visible when entered, and extra caution is taken to remove its characters from memory in the destructor.
PasswordString * can be passed to InDialog.add functions,
and InDialog uses *** to mask the input characters.


Constructor & Destructor Documentation

PasswordString ( int  inKnownLength = 0,
const SmartUtil::tstring &  inString = _T( "" ) 
)

Constructor that can specify a known length and an initial value.

A nonzero inKnownLength force the user to input that many characters, and thus enforces password strength standards, and prevents some typos.

~PasswordString (  ) 

Destructor attempts to remove the password characters from memory.

This might not work depending on how string is implemented, but the goal is to not leave the password in the heap somewhere.

Back to SmartWin website
SourceForge.net Logo