mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Add -i/--include option to "generate" CLI command. (#7112)
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
#ifndef KEEPASSX_PASSWORDGENERATOR_H
|
||||
#define KEEPASSX_PASSWORDGENERATOR_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QVector>
|
||||
|
||||
typedef QVector<QChar> PasswordGroup;
|
||||
@@ -28,6 +29,7 @@ class PasswordGenerator
|
||||
public:
|
||||
enum CharClass
|
||||
{
|
||||
NoClass = 0,
|
||||
LowerLetters = (1 << 0),
|
||||
UpperLetters = (1 << 1),
|
||||
Numbers = (1 << 2),
|
||||
@@ -41,10 +43,11 @@ public:
|
||||
EASCII = (1 << 9),
|
||||
DefaultCharset = LowerLetters | UpperLetters | Numbers
|
||||
};
|
||||
Q_DECLARE_FLAGS(CharClasses, CharClass)
|
||||
Q_DECLARE_FLAGS(CharClasses, CharClass);
|
||||
|
||||
enum GeneratorFlag
|
||||
{
|
||||
NoFlags = 0,
|
||||
ExcludeLookAlike = (1 << 0),
|
||||
CharFromEveryGroup = (1 << 1),
|
||||
AdvancedMode = (1 << 2),
|
||||
@@ -56,17 +59,25 @@ public:
|
||||
PasswordGenerator();
|
||||
|
||||
void setLength(int length);
|
||||
void setCharClasses(const CharClasses& classes);
|
||||
void setFlags(const GeneratorFlags& flags);
|
||||
void setAdditionalChars(const QString& chars);
|
||||
void setExcludedChars(const QString& chars);
|
||||
void setCharClasses(const CharClasses& classes);
|
||||
void setCustomCharacterSet(const QString& customCharacterSet);
|
||||
void setExcludedCharacterSet(const QString& excludedCharacterSet);
|
||||
void reset();
|
||||
|
||||
bool isValid() const;
|
||||
int getMinLength() const;
|
||||
|
||||
int getLength() const;
|
||||
const GeneratorFlags& getFlags() const;
|
||||
const CharClasses& getActiveClasses() const;
|
||||
const QString& getCustomCharacterSet() const;
|
||||
const QString& getExcludedCharacterSet() const;
|
||||
|
||||
QString generatePassword() const;
|
||||
|
||||
static const int DefaultLength = 32;
|
||||
static const char* DefaultAdditionalChars;
|
||||
static const int DefaultLength;
|
||||
static const char* DefaultCustomCharacterSet;
|
||||
static const char* DefaultExcludedChars;
|
||||
|
||||
private:
|
||||
@@ -76,10 +87,8 @@ private:
|
||||
int m_length;
|
||||
CharClasses m_classes;
|
||||
GeneratorFlags m_flags;
|
||||
QString m_additional;
|
||||
QString m_custom;
|
||||
QString m_excluded;
|
||||
|
||||
Q_DISABLE_COPY(PasswordGenerator)
|
||||
};
|
||||
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(PasswordGenerator::CharClasses)
|
||||
|
||||
Reference in New Issue
Block a user