QtPass  1.3.2
Multi-platform GUI for pass, the standard unix password manager.
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 
8 struct NamedValue {
9  QString name;
10  QString value;
11 };
12 
17 class NamedValues : public QList<NamedValue> {
18 public:
19  NamedValues();
20  NamedValues(std::initializer_list<NamedValue> values);
21 
22  QString takeValue(const QString &name);
23 };
24 
25 class FileContent {
26 public:
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 
70 private:
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
NamedValue::value
QString value
Definition: filecontent.h:10
FileContent::getNamedValues
NamedValues getNamedValues() const
Definition: filecontent.cpp:38
NamedValues
The NamedValues class is mostly a list of NamedValue but also has a method to take a specific NamedVa...
Definition: filecontent.h:17
FileContent
Definition: filecontent.h:25
NamedValue::name
QString name
Definition: filecontent.h:9
FileContent::getRemainingData
QString getRemainingData() const
Definition: filecontent.cpp:40
NamedValues::takeValue
QString takeValue(const QString &name)
Definition: filecontent.cpp:59
NamedValues::NamedValues
NamedValues()
Definition: filecontent.cpp:54
FileContent::getRemainingDataForDisplay
QString getRemainingDataForDisplay() const
Definition: filecontent.cpp:42
NamedValue
Definition: filecontent.h:8
FileContent::getPassword
QString getPassword() const
Definition: filecontent.cpp:36
FileContent::parse
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