-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (33 loc) · 1.15 KB
/
main.cpp
File metadata and controls
46 lines (33 loc) · 1.15 KB
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
41
42
43
44
45
#include "Partition.h"
#include "File.h"
#include <QCoreApplication>
#include <QDebug>
#include <iostream>
#include <typeinfo>
using namespace std;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
Folder& root{ Partition::instance(QStringLiteral("C:")) };
root.addFile(QStringLiteral ("autoexec.bat"), 5000);
Folder* r1{ root.addFolder(QStringLiteral ("winnt")) };
r1->addFile(QStringLiteral ("win.ini"), 300);
r1->addFile(QStringLiteral ("system.ini"), 7000);
r1->addFolder(QStringLiteral("system32"));
Folder* r2{ root.addFolder(QStringLiteral("temp")) };
r2->addFile(QStringLiteral("tmp1.dat"), 645);
auto file = r2->addFile(QStringLiteral("myDoc.txt"), 10000);
r2->addLink(QStringLiteral("racourci vers myDoc.txt"), *file);
qDebug() << root.getSize() << "octets";
delete r1->getElement (QStringLiteral("win.ini"));
qDebug() << root.getSize() << "octets";
qDebug() << file->getAbsolutePath();
QTextStream ts(stderr);
root.display(ts);
ts.flush();
delete file;
qDebug() << root.getSize() << "octets";
root.display(ts);
ts.flush();
return a.exec();
}