SourceForge Logo
Main Page   Class Hierarchy   Compound List   File List   Compound Members  

PasswordInfos Class Reference

Structure holding the password informations. More...

#include <PasswordInfos.h>

Inheritance diagram for PasswordInfos:

PassguardErrorManager List of all members.

Public Methods

 PasswordInfos (unsigned int nb_elements)
 Constructor of the structure holding the password informations. More...

 PasswordInfos (const PasswordInfos &password_infos)
 Copy constructor of the structure holding the password informations. More...

 ~PasswordInfos ()
 Destructor of the structure holding the password informations. More...

string getElement (unsigned int nth)
 Informs of the nth elements of the password informations. More...

bool setElement (unsigned int nth, string name)
 Defines the nth elements of the password informations. More...

string & operator[] (int nth)
 Returns a reference to the nth elements of the password informations. More...

unsigned int getNbElements (void) const
 Returns the number of element of the structure. More...

string getPassword (void) const
 Returns the password of the structure. More...

void setPassword (string password)
 Defines the password of the structure. More...

string getDescription (void) const
 Returns the additional description. More...

void setDescription (string description)
 Defines the additional description. More...

bool isEqualUntilLevel (PasswordInfos password_infos, int nth)
 Check equality for each element until the nth element. More...

bool operator== (PasswordInfos &password_infos)
 Checks if the password's structure are strictly equal. More...

PasswordInfos & operator= (const PasswordInfos &password_infos)
 Affects the password structure to the current one. More...

string getString (char inline_separator)
 Returns a string with all the password informations separated by the character inline_separator. More...

void print (void)
 Display the PasswordInfos structure data in a human readable way. More...

void print (PasswordInfos fields_name)
 Display the PasswordInfos structure data in a human readable way with field name. More...


Detailed Description

Structure holding the password informations.

It is composed by a password string, a vector of elements describing what the password is for (eg. host, service, user, etc.) and a description string to give more information if necessary.

The elements' vector will be the basis for the construction of the password tree. Each element represent a branch of the tree and the password is the leaf.


Constructor & Destructor Documentation

PasswordInfos::PasswordInfos unsigned int    nb_elements
 

Constructor of the structure holding the password informations.

Parameters:
nb_elements  max number of elements of the password informations
Returns:
none

PasswordInfos::PasswordInfos const PasswordInfos &    password_infos
 

Copy constructor of the structure holding the password informations.

Parameters:
password_infos  the object to copy
Returns:
none

PasswordInfos::~PasswordInfos  
 

Destructor of the structure holding the password informations.

Returns:
none


Member Function Documentation

string PasswordInfos::getDescription void    const
 

Returns the additional description.

Returns:
the additional description or empty string if not found

string PasswordInfos::getElement unsigned int    nth
 

Informs of the nth elements of the password informations.

Parameters:
nth  index of the element
Returns:
the element requested or empty string if not found

unsigned int PasswordInfos::getNbElements void    const
 

Returns the number of element of the structure.

Returns:
the number of element of the structure

string PasswordInfos::getPassword void    const
 

Returns the password of the structure.

Returns:
the password of the structure or empty string if not found

string PasswordInfos::getString char    inline_separator
 

Returns a string with all the password informations separated by the character inline_separator.

Parameters:
inline_separator  the character you want between each elements
Returns:
the string holding the password informations

bool PasswordInfos::isEqualUntilLevel PasswordInfos    password_infos,
int    nth
 

Check equality for each element until the nth element.

Parameters:
password_infos  the passwords infos to check for equality with the current one
nth  level until which we want to test equality (-1 checks for perfect equality)
Returns:
true if it succeeds / false otherwise
Note:
if nth = nbElement+1, checks for password equality too, and if nth >= nbElement+2, checks for perfect equality (elements + pass + desc)
Note:
if the number of element of each passwords infos doesn't match, we consider they aren't equals

PasswordInfos & PasswordInfos::operator= const PasswordInfos &    password_infos
 

Affects the password structure to the current one.

Parameters:
password_infos  the password structure to affect
Returns:
the modified current structure

bool PasswordInfos::operator== PasswordInfos &    password_infos
 

Checks if the password's structure are strictly equal.

Parameters:
password_infos  the password structure to test
Returns:
true if they are equal / false otherwise

string & PasswordInfos::operator[] int    nth
 

Returns a reference to the nth elements of the password informations.

Parameters:
nth  index of the element
Returns:
the reference to the element requested
Warning:
No boundary check is performed in this function, so you must check that nth is in the boundary

void PasswordInfos::print PasswordInfos    fields_name
 

Display the PasswordInfos structure data in a human readable way with field name.

Parameters:
fields_name  a PasswordInfos structure with the name of each fields
Returns:
none

void PasswordInfos::print void   
 

Display the PasswordInfos structure data in a human readable way.

Returns:
none

void PasswordInfos::setDescription string    description
 

Defines the additional description.

Parameters:
description  the additional description
Returns:
none

bool PasswordInfos::setElement unsigned int    nth,
string    name
 

Defines the nth elements of the password informations.

Parameters:
nth  index of the element
name  new name of the element
Returns:
true if the index is in the bound, false otherwise

void PasswordInfos::setPassword string    password
 

Defines the password of the structure.

Parameters:
password  the new password
Returns:
none


The documentation for this class was generated from the following files:
Generated on Sun Mar 9 15:36:52 2003 for PassGuardFramework by doxygen1.2.15