LMMS
Loading...
Searching...
No Matches
PathUtil.h
Go to the documentation of this file.
1/*
2 * PathUtil.h
3 *
4 * Copyright (c) 2019-2022 Spekular <Spekularr@gmail.com>
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#ifndef LMMS_PATHUTIL_H
26#define LMMS_PATHUTIL_H
27
28#include "lmms_export.h"
29
30#include <QDir>
31
32namespace lmms::PathUtil
33{
37
42 QString LMMS_EXPORT baseLocation(const Base base, bool* error = nullptr);
46 QDir LMMS_EXPORT baseQDir (const Base base, bool* error = nullptr);
48 QString LMMS_EXPORT basePrefix(const Base base);
51 Base LMMS_EXPORT baseLookup(const QString& input);
52
54 QString LMMS_EXPORT stripPrefix(const QString& input);
56 QString LMMS_EXPORT cleanName(const QString& input);
57
59 QString LMMS_EXPORT oldRelativeUpgrade(const QString& input);
60
63 QString LMMS_EXPORT toAbsolute(const QString& input, bool* error = nullptr);
65 QString LMMS_EXPORT relativeOrAbsolute(const QString& input, const Base base);
69 QString LMMS_EXPORT toShortestRelative(const QString& input, bool allowLocal = false);
70
71} // namespace lmms::PathUtil
72
73#endif // LMMS_PATHUTIL_H
Definition PathUtil.cpp:11
QDir baseQDir(const Base base, bool *error)
Definition PathUtil.cpp:68
QString toAbsolute(const QString &input, bool *error)
Definition PathUtil.cpp:169
QString relativeOrAbsolute(const QString &input, const Base base)
Make this path relative to a given base, return an absolute path if that fails.
Definition PathUtil.cpp:188
Base baseLookup(const QString &input)
Definition PathUtil.cpp:100
QString stripPrefix(const QString &input)
Remove the prefix from a path, iff there is one.
Definition PathUtil.cpp:123
QString toShortestRelative(const QString &input, bool allowLocal)
Definition PathUtil.cpp:203
QString basePrefix(const Base base)
Return the prefix used to denote this base in path strings.
Definition PathUtil.cpp:78
QString oldRelativeUpgrade(const QString &input)
Upgrade prefix-less relative paths to the new format.
Definition PathUtil.cpp:142
Base
Definition PathUtil.h:34
@ UserLADSPA
Definition PathUtil.h:35
@ UserSoundfont
Definition PathUtil.h:35
@ UserGIG
Definition PathUtil.h:35
@ UserSample
Definition PathUtil.h:34
@ LocalDir
Definition PathUtil.h:36
@ ProjectDir
Definition PathUtil.h:34
@ FactoryPresets
Definition PathUtil.h:35
@ DefaultLADSPA
Definition PathUtil.h:35
@ DefaultSoundfont
Definition PathUtil.h:35
@ FactorySample
Definition PathUtil.h:34
@ Absolute
Definition PathUtil.h:34
@ UserVST
Definition PathUtil.h:34
@ Preset
Definition PathUtil.h:34
@ FactoryProjects
Definition PathUtil.h:34
@ DefaultGIG
Definition PathUtil.h:35
QString cleanName(const QString &input)
Get the filename for a path, handling prefixed paths correctly.
Definition PathUtil.cpp:131
QString baseLocation(const Base base, bool *error)
Definition PathUtil.cpp:16
int error
Definition extract.c:1038