-
Notifications
You must be signed in to change notification settings - Fork 0
/
FileName.h
40 lines (34 loc) · 938 Bytes
/
FileName.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: AGPL-3.0-or-later
// (C) 2023 Bernhard Rosenkränzer <[email protected]>
#pragma once
#include "String.h"
#include <QList>
extern "C" {
#include <rpm/rpmfiles.h>
}
/**
* A file name.
*/
class FileName:public String {
public:
FileName(String s):String(s) {}
FileName(char const *data, qsizetype size = -1):String(data, size) {}
FileName(QString const &s):String(s) {}
String basename(String const &extension=String()) const;
String dirname() const;
};
class FileInfo {
public:
FileInfo(FileName const &name, enum rpmfileAttrs_e attr, mode_t mode):_name(name),_attributes(attr),_mode(mode) {}
FileName const &name() const { return _name; }
rpmfileAttrs_e attributes() const { return _attributes; }
mode_t mode() const { return _mode; }
private:
FileName _name;
enum rpmfileAttrs_e _attributes;
mode_t _mode;
};
class Files:public QList<FileInfo> {
};
class FileNames:public QList<FileName> {
};