-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathparser.h
More file actions
45 lines (34 loc) · 1.03 KB
/
Copy pathparser.h
File metadata and controls
45 lines (34 loc) · 1.03 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
#ifndef PARSER_H
#define PARSER_H
#include <QString>
#include <QDir>
#include <QTextStream>
struct Stream {
QString url;
QString name;
Stream(QString u, QString d): url(u), name(d) {};
};
//typedef std::list<Stream> StreamList;
typedef QList<Stream> StreamList;
class Parser {
public:
Parser(const QString&);
bool saveStreams(); // Overwrite input file.
bool saveStreams(const QString&); // Save to new file.
StreamList::iterator streamsBegin();
StreamList::const_iterator streamsBegin() const;
StreamList::iterator streamsEnd();
StreamList::const_iterator streamsEnd() const;
void swapStreams(unsigned int, unsigned int);
void deleteStream(unsigned int);
void insertStream(const Stream&);
private:
StreamList streams_;
QString filename_;
QString live_stream_def_line_;
void readStreams();
QString unescapeString(const QString&) const;
QString escapeString(const QString&) const;
QChar getCodePoint(unsigned int byte) const;
};
#endif // PARSER_H