QtPass  1.2.3
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 
64 private:
65  FileContent(const QString &password, const NamedValues &namedValues,
66  const QString &remainingData);
67 
68  QString password;
69  NamedValues namedValues;
70  QString remainingData;
71 };
72 
73 #endif // FILECONTENT_H
The NamedValues class is mostly a list of NamedValue but also has a method to take a specific NamedVa...
Definition: filecontent.h:17
NamedValues getNamedValues() const
Definition: filecontent.cpp:30
QString takeValue(const QString &name)
Definition: filecontent.cpp:45
QString value
Definition: filecontent.h:10
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:3
QString getRemainingData() const
Definition: filecontent.cpp:32
QString getPassword() const
Definition: filecontent.cpp:28
QString name
Definition: filecontent.h:9