LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
paths.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <functional>
12#include <QStringList>
13#include <QFileInfo>
14#include "sysconfig.h"
15
16class QDir;
17class QUrl;
18
19namespace LC::Util
20{
25 enum class SysPath
26 {
32 QML,
33
39 Share
40 };
41
69
99
116
127
143 const std::function<bool (QFileInfo)>& filter = {});
144
147 enum class UserDir
148 {
151 Cache,
152
155 LC
156 };
157
159
172
182
204
214}
Container< T > Filter(const Container< T > &c, F f)
Definition prelude.h:118
QString GetSysPath(SysPath path, const QString &suffix, const QString &filename)
Returns path to the file in the given root path and subfolder.
Definition paths.cpp:56
QStringList GetSystemPaths()
Returns the components of the system PATH variable.
Definition paths.cpp:74
QString GetTemporaryName(const QString &pattern)
Returns a temporary filename.
Definition paths.cpp:143
QString FindInSystemPath(const QString &name, const QStringList &paths, const std::function< bool(QFileInfo)> &filter)
Searches for a file in system paths according to a filter.
Definition paths.cpp:79
UserDir
Describes various user-specific paths.
Definition paths.h:148
@ Cache
Cache for volatile data.
QStringList GetPathCandidates(SysPath path, QString suffix)
Returns possible full paths for the path and subfolder.
Definition paths.cpp:24
QDir GetUserDir(UserDir dir, const QString &subpath)
Definition paths.cpp:97
QUrl GetSysPathUrl(SysPath path, const QString &subfolder, const QString &filename)
Returns path to the file in the given root path and subfolder.
Definition paths.cpp:69
SysPath
Describes various root paths recognized by GetSysPath().
Definition paths.h:26
@ Share
Directory with shared data files.
@ QML
Root path for QML files.
SpaceInfo GetSpaceInfo(const QString &path)
Returns the disk space info of the partition containing path.
Definition paths.cpp:154
QDir CreateIfNotExists(QString path)
Creates a path if it doesn't exist.
Definition paths.cpp:126
Definition constants.h:15
Contains information about a partition's disk space.
Definition paths.h:186
quint64 Free_
How much free space there is.
Definition paths.h:195
quint64 Capacity_
The capacity of the partition.
Definition paths.h:189
quint64 Available_
How much space is available to the current user.
Definition paths.h:202
#define UTIL_SYS_API
Definition sysconfig.h:16