QtPass
2.0.0
Developer documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
passwordconfiguration.h
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2018 Anne Jan Brouwer
2
// SPDX-License-Identifier: GPL-3.0-or-later
8
#ifndef SRC_PASSWORDCONFIGURATION_H_
9
#define SRC_PASSWORDCONFIGURATION_H_
10
11
#include <QString>
12
#include <array>
13
23
struct
PasswordConfiguration
{
28
enum
CharacterSet
{
29
ALLCHARS
= 0,
30
ALPHABETICAL
,
31
ALPHANUMERIC
,
32
CUSTOM
,
33
CHARSETS_COUNT
35
};
36
39
CharacterSet
selected
{
ALLCHARS
};
43
int
length
{16};
48
std::array<QString, CHARSETS_COUNT>
Characters
;
52
PasswordConfiguration
() {
53
Characters
[
ALLCHARS
] =
54
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890~!@#$%^&"
55
"*()_-+={}[]|:;<>,.?"
;
/*AllChars*/
56
Characters
[
ALPHABETICAL
] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
57
"vwxyz"
;
/*Only Alphabetical*/
58
Characters
[
ALPHANUMERIC
] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
59
"vwxyz1234567890"
;
/*Alphabetical and Numerical*/
60
Characters
[
CUSTOM
] =
Characters
[
ALLCHARS
];
// may be redefined by user
61
}
62
};
63
64
#endif
// SRC_PASSWORDCONFIGURATION_H_
PasswordConfiguration::length
int length
Length of the generated password, in characters.
Definition
passwordconfiguration.h:43
PasswordConfiguration::selected
CharacterSet selected
Currently active character set selection.
Definition
passwordconfiguration.h:39
PasswordConfiguration::CharacterSet
CharacterSet
Character set options for password generation; also the index into Characters.
Definition
passwordconfiguration.h:28
PasswordConfiguration::ALPHABETICAL
@ ALPHABETICAL
Definition
passwordconfiguration.h:30
PasswordConfiguration::CHARSETS_COUNT
@ CHARSETS_COUNT
Definition
passwordconfiguration.h:33
PasswordConfiguration::ALLCHARS
@ ALLCHARS
Definition
passwordconfiguration.h:29
PasswordConfiguration::CUSTOM
@ CUSTOM
Definition
passwordconfiguration.h:32
PasswordConfiguration::ALPHANUMERIC
@ ALPHANUMERIC
Definition
passwordconfiguration.h:31
PasswordConfiguration::PasswordConfiguration
PasswordConfiguration()
Construct a PasswordConfiguration with sensible defaults.
Definition
passwordconfiguration.h:52
PasswordConfiguration::Characters
std::array< QString, CHARSETS_COUNT > Characters
The alphabet of each character set, indexed by CharacterSet. Only the CUSTOM entry is meant to be cha...
Definition
passwordconfiguration.h:48
src
passwordconfiguration.h
Generated by
1.18.0