-
Notifications
You must be signed in to change notification settings - Fork 0
/
filemanager.cpp
107 lines (97 loc) · 2.51 KB
/
filemanager.cpp
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "filemanager.h"
#include <QDir>
#include <qdir.h>
#include <QtDebug>
#include <QDebug>
//#include "mainwindow.h"
//#include "ui_mainwindow.h"
//extern Ui::MainWindow *ui;
/*
filemanager::filemanager(QObject *parent) : QObject(parent)
{
}
QString filemanager::fileFirstFound(QString dir)
{
//QString path = "D:/ZIO";
QDir dir_path(dir);
QString str;
foreach(QFileInfo item, dir_path.entryInfoList())
{
//QFileInfo item;
if(item.isDir())
qDebug() << "Dir: " << item.absoluteFilePath();
if(item.isFile()){
//qDebug() << "File: " << item.fileName();
str = item.fileName();
qDebug() << "File: " << str;
qDebug() << "File: " << item.size();
//qDebug() << "File: " << item.;
//qDebug() << "File: " << item.;
return str;
}
//if(item.)
//qDebug() << "File: " << item.absoluteFilePath();
}
return "NULL";
}
*/
/*
bool filemanager::fileWrite(int i, QString path, QString data)
{
//bool openok = false;
QFile file(path); //"D://ZIO/out.txt");
if(i==0){
//QFile file(path); //"D://ZIO/out.txt");
if (!file.open(QIODevice::WriteOnly|QIODevice::Text)){
qDebug() << "open fail";
return false;
}
}
filemanager fman;
QString fileStr;
QTextStream out(&file);
// int i = 0;
*/
/* for(i=0;i<ui->lw_data->count();i++){
//qDebug() << list_result->item(i)->text().toFloat();
fileStr = ui->lw_data->item(i)->text();//ui->lw_data->item(i)->text();
out << fileStr;
qDebug() << fileStr;
}
*/
/*
//QTextStream out(&file);
//out << "The magic number is: " << 49 << "\n";
//out << data;
//out << data;
//out << data;
//out << data;
//qDebug() << "open OK";
//return true;
//}else{
//}
}
*/
/*
QString filemanager::fileRead(QString path)
{
QFile file(path); //("D://ZIO/out.txt");
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
return "NULL";
QTextStream in(&file);
//!in.readAll()) {
QString line = in.readLine();
qDebug() << "line.." << line;
//process_line(line);
return line;
//}
}
*/
/*
bool filemanager::fileDelete(QString path)
{
QFile file(path); //"D://ZIO/out.txt");
file.remove();
return true;
}
*/