Zrythm v2.0.0-DEV
a highly automated and intuitive digital audio workstation
Loading...
Searching...
No Matches
file_path_list.h
1// SPDX-FileCopyrightText: © 2024 Alexandros Theodotou <alex@zrythm.org>
2// SPDX-License-Identifier: LicenseRef-ZrythmLicense
3
4#pragma once
5
6#include "utils/utf8_string.h"
7
8#include <QObject>
9#include <QtQmlIntegration/qqmlintegration.h>
10
11#include "juce_wrapper.h"
12
13namespace zrythm::utils
14{
15
16class FilePathList : public QObject
17{
18 Q_OBJECT
19 Q_PROPERTY (
20 QStringList paths READ getPaths WRITE setPaths NOTIFY pathsChanged FINAL)
21
22public:
23 FilePathList (QObject * parent = nullptr);
24 FilePathList (juce::FileSearchPath paths, QObject * parent = nullptr);
25
26 Q_SIGNAL void pathsChanged ();
27
28 QStringList getPaths () const;
29 void setPaths (const QStringList &paths);
30
31 Q_INVOKABLE void addPath (const QString &path);
32 Q_INVOKABLE void clear ();
33
34 void add_path (const fs::path &path);
35 void add_path (const Utf8String &path);
36 void add_paths (const juce::FileSearchPath &paths);
37 juce::FileSearchPath get_as_juce_file_search_path () const;
38
42 void print (const utils::Utf8String &title) const;
43
44 auto begin () const { return paths_.begin (); }
45 auto end () const { return paths_.end (); }
46 auto begin () { return paths_.begin (); }
47 auto end () { return paths_.end (); }
48
49 bool empty () const { return paths_.empty (); }
50
51private:
52 std::vector<fs::path> paths_;
53};
54
55} // namespace zrythm::utils
void print(const utils::Utf8String &title) const
For debugging.
Lightweight UTF-8 string wrapper with safe conversions.
Definition utf8_string.h:38
String utilities.
Definition algorithms.h:12