-
Notifications
You must be signed in to change notification settings - Fork 1
/
passwordmanage.h
68 lines (50 loc) · 1.52 KB
/
passwordmanage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef PASSWORDMANAGE_H
#define PASSWORDMANAGE_H
#include <QString>
#include "iniservice.h"
#include <QFile>
#include <QIODevice>
class PasswordManage
{
public:
PasswordManage(QString tcurrentUser);
INIService *INIPWManage;
//读取所有密码
void readAllLabel();
//读取选中的密码的具体内容
void readSelectedLabel(QString tlabel);
//编辑选中的密码
void editSelectedLabel(QString tlabel,QString tname,QString tpassword,QString ttarget,QString tothers);
//删除选中的密码
void deleSelectedLabel(QString tlabel);
//添加密码
void addNewLabel(QString tlabel,QString tname,QString tpassword,QString ttarget,QString tothers);
//导出所有密码
bool outputAllInfo(QString filePath);
//获取所有密码
QStringList getAllLabel();
//获取选中的密码的具体内容
QString getNowLabel();
QString getNowName();
QString getNowPassword();
QString getNowTarget();
QString getNowOthers();
//获取一个随机字符串(随机密码)
QString getRandomPW(int minLength,int maxLength);
//查询密码是否已存在
bool labelExist(QString tlabel);
private:
//当前用户
QString currentUser;
//密码配置文件路径
QString passwordINIPath;
//保存所有密码的标签
QStringList listOfAllLabel;
//当前密码的具体内容
QString nowLabel;
QString nowName;
QString nowPassword;
QString nowTarget;
QString nowOthers;
};
#endif // PASSWORDMANAGE_H