|
QtPass 2.0.0
Developer documentation
|
Read and write password-store template configuration. More...
#include <templateio.h>
Static Public Member Functions | |
| static auto | readTemplates (const QString &storePath) -> QHash< QString, QStringList > |
| Read templates from .templates file in password store. | |
| static auto | writeTemplates (const QString &storePath, const QHash< QString, QStringList > &templates) -> bool |
| Write templates to .templates file in password store. | |
| static auto | getFolderTemplate (const QString &folderPath, const QString &storePath) -> QString |
| Get default template for a folder. Looks in folder, then parent folders up to root. | |
| static auto | secretFieldsIn (const QString &templateText) -> QStringList |
| The field names a template marks as secret. | |
| static auto | readSecretFields (const QString &storePath) -> QStringList |
| The field names the store's .templates file marks as secret, in any of its sections (see secretFieldsIn()). | |
| static auto | fieldsIn (const QString &templateText) -> QStringList |
| The field names of the template in the settings: one per line, with comment lines (starting with #, such as a # secret: line) left out. Other lines are kept as they are, empty ones too. | |
Read and write password-store template configuration.
Extracted from Util. Owns the .templates INI-style file (named template sections with field lists) and the per-folder .default_template lookup used to pick a default template when adding a password.
Definition at line 24 of file templateio.h.
|
static |
The field names of the template in the settings: one per line, with comment lines (starting with #, such as a # secret: line) left out. Other lines are kept as they are, empty ones too.
| templateText | The template's text, newline-separated. |
Definition at line 139 of file templateio.cpp.
|
static |
Get default template for a folder. Looks in folder, then parent folders up to root.
| folderPath | Path to folder. |
| storePath | Path to password store root. |
Definition at line 176 of file templateio.cpp.
|
static |
The field names the store's .templates file marks as secret, in any of its sections (see secretFieldsIn()).
| storePath | Path to password store root. |
Definition at line 133 of file templateio.cpp.
|
static |
Read templates from .templates file in password store.
| storePath | Path to password store root. |
Definition at line 75 of file templateio.cpp.
|
static |
The field names a template marks as secret.
A line # secret: pin, cvv names them, separated by commas; "secret" may be written in any case. It is a comment line, so pass, QtPass 1.8 and the field list skip it. Names are trimmed and empty ones dropped; every other line is ignored. A marked field is hidden like the password (PasswordDisplayPanel), matched by its whole name in any case.
| templateText | The text of a template: the store's .templates file or the template in the settings. |
Definition at line 111 of file templateio.cpp.
|
static |
Write templates to .templates file in password store.
| storePath | Path to password store root. |
| templates | Hash of template name to field list. |
Definition at line 147 of file templateio.cpp.