-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparser.cpp
More file actions
79 lines (61 loc) · 1.12 KB
/
parser.cpp
File metadata and controls
79 lines (61 loc) · 1.12 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
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
#include "parser.h"
#include <QDebug>
#include <QDir>
#include <QDirIterator>
Parser::Parser()
: m_type{Parser::NoType}
{
}
Parser::~Parser()
{
}
Parser::FileType Parser::fileType()
{
return m_type;
}
void Parser::setFileType(Parser::FileType type)
{
m_type = type;
}
void Parser::setExportPath(const QString path)
{
export_info.setFile(path);
}
void Parser::setExportFile(const QString file)
{
export_file = file;
}
void Parser::setDelimiters(const QStringList list)
{
m_delims = list;
}
void Parser::setDelimiters(const QString &delim)
{
m_delims.append(delim);
}
QStringList Parser::delimiters() const
{
return m_delims;
}
QString Parser::exportFile() const
{
return export_file;
}
QFileInfo Parser::exportInfo() const
{
return export_info;
}
void Parser::parse()
{
return;
}
QStringList Parser::getFiles(const QString path)
{
qDebug() << "Dir exists? " << QDir(path).exists();
QStringList list;
QDirIterator iter(path, delimiters(), QDir::Files, QDirIterator::NoIteratorFlags);
while (iter.hasNext()) {
list.append(iter.next());
}
return list;
}