33 #include <QTextStream>
44 #define PARSE_SKIP(VAR) do { \
45 if (it == tokens.end()) return false; \
48 #define PARSE_CONF(VAR) do { \
49 if (it == tokens.end() || !(VAR).ParseConf(*it++)) \
50 return false; } while(false)
52 #define PARSE_STR(VAR) do { \
53 if (it != tokens.end()) (VAR) = *it++; else return false; } while(false)
55 #define PARSE_UINT(VAR) do { \
56 if (it != tokens.end()) \
57 (VAR) = (*it++).toUInt(); else return false; } while(false)
59 #define PARSE_UINT_1000(VAR) do { \
60 if (it != tokens.end()) \
61 (VAR) = (*it++).toUInt() * 1000ULL; else return false; } while(false)
75 if (!
file.open(QIODevice::ReadOnly))
79 QTextStream stream(&
file);
81 while (!stream.atEnd())
83 line = stream.readLine();
84 line = line.trimmed();
85 if (line.startsWith(
"#"))
88 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
89 QStringList list = line.split(
":", QString::SkipEmptyParts);
91 QStringList list = line.split(
":", Qt::SkipEmptyParts);
97 QString str = list[0];
100 if ((str.length() >= 1) && (str.at(0) ==
'@'))
102 channelNo = str.mid(1).toInt();
103 line = stream.readLine();
104 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
105 list = line.split(
":", QString::SkipEmptyParts);
107 list = line.split(
":", Qt::SkipEmptyParts);
116 if ((str ==
"T") || (str ==
"C") || (str ==
"S"))
142 QStringList::const_iterator it = tokens.begin();
168 QStringList::const_iterator it = tokens.begin();
187 QStringList::const_iterator it = tokens.begin();
209 QStringList::const_iterator it = tokens.begin();
230 QStringList::const_iterator it = tokens.begin();
232 chan.
m_lcn = channelNo;
240 if (it == tokens.end())
243 QString params = (*it++);
244 while (!params.isEmpty())
246 QString ori = params;
247 int s = (int) (params.toLatin1().constData()[0]);
248 params = params.mid(1);
292 for (
uint i = 0; i < 6; i++)
308 channel.channels.push_back(chan);
310 LOG(VB_GENERAL, LOG_INFO,
"Imported channel: " + chan.
toString() +
319 LOG(VB_GENERAL, LOG_INFO,
"Imported channel: " + chan.
toString() +