QtPass 1.6.0
Multi-platform GUI for pass, the standard unix password manager.
Loading...
Searching...
No Matches
FileContent Class Reference

#include <filecontent.h>

Public Member Functions

auto getPassword () const -> QString
 Gets the password from the parsed file.
auto getNamedValues () const -> NamedValues
 Gets named value pairs from the parsed file.
auto getRemainingData () const -> QString
 Gets remaining data not in named values.
auto getRemainingDataForDisplay () const -> QString
 Gets remaining data for display (excludes hidden fields like OTP).

Static Public Member Functions

static auto parse (const QString &fileContent, const QStringList &templateFields, bool allFields) -> FileContent
 parse parses the given fileContent in a FileContent object. The password is accessible through getPassword. The named value pairs (name: value) are parsed and depeding on the templateFields and allFields parameters accessible through getNamedValues, getRemainingData or getRemainingDataForDisplay.

Detailed Description

Definition at line 31 of file filecontent.h.

Member Function Documentation

◆ getNamedValues()

auto FileContent::getNamedValues ( ) const -> NamedValues
nodiscard

Gets named value pairs from the parsed file.

Returns
the named values in the file in the order of appearence, with template values first.
NamedValues list with name:value pairs
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 68 of file filecontent.cpp.

Here is the caller graph for this function:

◆ getPassword()

auto FileContent::getPassword ( ) const -> QString
nodiscard

Gets the password from the parsed file.

Returns
the password from the parsed file.
The password string
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 62 of file filecontent.cpp.

Here is the caller graph for this function:

◆ getRemainingData()

auto FileContent::getRemainingData ( ) const -> QString
nodiscard

Gets remaining data not in named values.

Returns
the data that is not the password and not in getNamedValues.
Remaining data as string

Definition at line 76 of file filecontent.cpp.

Here is the caller graph for this function:

◆ getRemainingDataForDisplay()

auto FileContent::getRemainingDataForDisplay ( ) const -> QString
nodiscard

Gets remaining data for display (excludes hidden fields like OTP).

@like getRemainingData but without data that should not be displayed (like a TOTP secret).

Returns
Remaining data suitable for display
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 84 of file filecontent.cpp.

Here is the caller graph for this function:

◆ parse()

auto FileContent::parse ( const QString & fileContent,
const QStringList & templateFields,
bool allFields ) -> FileContent
static

parse parses the given fileContent in a FileContent object. The password is accessible through getPassword. The named value pairs (name: value) are parsed and depeding on the templateFields and allFields parameters accessible through getNamedValues, getRemainingData or getRemainingDataForDisplay.

Parses password file content into structured data.

Parameters
fileContentthe file content to parse.
templateFieldsthe fields in the template. Fields in the template will always be in getNamedValues() at the beginning of the list in the same order.
allFieldswhether all fields should be considered as named values. If set to false only templateFields are returned in getNamedValues().
Returns
Parameters
fileContentRaw file content
templateFieldsFields defined in the template
allFieldsWhether to include all name:value pairs
Returns
Parsed FileContent object
Examples
/home/annejan/Projects/QtPass/src/mainwindow.cpp.

Definition at line 24 of file filecontent.cpp.

Here is the caller graph for this function:

The documentation for this class was generated from the following files: