QtPass 2.0.0
Developer documentation
Loading...
Searching...
No Matches
pathvalidator.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2014 Anne Jan Brouwer
2// SPDX-License-Identifier: GPL-3.0-or-later
8#ifndef SRC_PATHVALIDATOR_H_
9#define SRC_PATHVALIDATOR_H_
10
11#include <QString>
12#include <optional>
13
31class PathValidator {
32public:
53 static auto isPathInStore(const QString &storeRoot, const QString &candidate)
54 -> bool;
55
69 static auto storeRelativePath(const QString &storeRoot,
70 const QString &candidate)
71 -> std::optional<QString>;
72
85 static auto isTargetSpelled(const QString &storeRoot, const QString &path)
86 -> bool;
87
88private:
89 PathValidator() = default;
90};
91
92#endif // SRC_PATHVALIDATOR_H_
static auto storeRelativePath(const QString &storeRoot, const QString &candidate) -> std::optional< QString >
Where candidate lies in the store, judged as isPathInStore() judges it.
static auto isPathInStore(const QString &storeRoot, const QString &candidate) -> bool
Check that a candidate path resolves inside the password store root, after following symlinks and res...
static auto isTargetSpelled(const QString &storeRoot, const QString &path) -> bool
Whether path is spelled through the target of a store root that is itself a link, rather than from th...