Credentials_manager/PasswordManager/record.cpp

158 lines
3.2 KiB
C++

#include "record.h"
Record::Record()
{
}
Record::~Record()
{
}
Record::Record(int id,
QString name,
QString username,
QString password,
QString URL,
QString note){
this->id = id;
this->name = name;
this->username = username;
this->password = password;
this->URL = URL;
this->note = note;
this->time = QDateTime::currentDateTime();
}
Record::Record(int id,
QString name,
QString username,
QString password,
QString URL,
QString note,
QString status){
this->id = id;
this->name = name;
this->username = username;
this->password = password;
this->URL = URL;
this->note = note;
this->time = QDateTime::currentDateTime();
this->status = status;
}
Record::Record(int id,
QString name,
QString username,
QString password,
QString URL){
this->id = id;
this->name = name;
this->username = username;
this->password = password;
this->URL = URL;
this->time = QDateTime::currentDateTime();
}
Record::Record(QString name,
QString username,
QString password,
QString URL,
QString note){
this->name = name;
this->username = username;
this->password = password;
this->URL = URL;
this->note = note;
this->time = QDateTime::currentDateTime();
}
Record::Record(int id,
QString name,
QString username,
QString password,
QString URL,
QString note,
QString status){
this->name = name;
this->username = username;
this->password = password;
this->URL = URL;
this->note = note;
this->time = QDateTime::currentDateTime();
this->status = status;
}
int Record::getId() const{
return id;
}
QString Record::getName() const{
return name;
}
QString Record::getUsername() const{
return username;
}
QString Record::getPassword() const
{
return password;
}
QString Record::getURL() const{
return URL;
}
QString Record::getNote() const{
return note;
}
QDateTime Record::getTime() const{
return time;
}
QString Record::getStatus() const
{
return status;
}
QString Record::toString()const
{
QString s = "";
s+="id : " + this->id;
s+="\nname : " + this->name;
s+="\nusername : " + this->username;
s+="\nurl : " + this->URL;
s+="\nnote : " + this->note;
s+="\ntime : " + this->time.toString();
s+="\n";
return s;
}
std::string Record::toStdString()const
{
return toString().toStdString();
}
void Record::setId(int i)
{
id = i;
}
void Record::setName(QString const name){
this->name = name;
}
void Record::setUsername(QString const username){
this->username = username;
}
void Record::setPassword(QString const password)
{
this->password = password;
}
void Record::setURL(QString const URL){
this->URL = URL;
}
void Record::setNote(QString const note){
this->note = note;
}
void Record::setTime(QDateTime const time){
this->time = time;
}
void Record::setStatus(const QString status)
{
this->status = status;
}