QtPass 1.4.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
filecontent.h
Go to the documentation of this file.
1#ifndef FILECONTENT_H
2#define FILECONTENT_H
3
4#include <QList>
5#include <QString>
6#include <QStringList>
7
8struct NamedValue {
9 QString name;
10 QString value;
11};
12
17class NamedValues : public QList<NamedValue> {
18public:
20 NamedValues(std::initializer_list<NamedValue> values);
21
22 QString takeValue(const QString &name);
23};
24
26public:
45 static FileContent parse(const QString &fileContent,
46 const QStringList &templateFields, bool allFields);
47
51 QString getPassword() const;
52
58
62 QString getRemainingData() const;
63
68 QString getRemainingDataForDisplay() const;
69
70private:
71 FileContent(const QString &password, const NamedValues &namedValues,
72 const QString &remainingData,
73 const QString &remainingDataDisplay);
74
75 QString password;
76 NamedValues namedValues;
77 QString remainingData, remainingDataDisplay;
78};
79
80#endif // FILECONTENT_H
QString getRemainingData() const
Definition: filecontent.cpp:40
QString getRemainingDataForDisplay() const
Definition: filecontent.cpp:42
QString getPassword() const
Definition: filecontent.cpp:36
NamedValues getNamedValues() const
Definition: filecontent.cpp:38
static FileContent parse(const QString &fileContent, const QStringList &templateFields, bool allFields)
parse parses the given fileContent in a FileContent object. The password is accessible through getPas...
Definition: filecontent.cpp:7
The NamedValues class is mostly a list of NamedValue but also has a method to take a specific NamedVa...
Definition: filecontent.h:17
QString takeValue(const QString &name)
Definition: filecontent.cpp:59
QString name
Definition: filecontent.h:9
QString value
Definition: filecontent.h:10