本文整理汇总了C++中Functions::Url方法的典型用法代码示例。如果您正苦于以下问题:C++ Functions::Url方法的具体用法?C++ Functions::Url怎么用?C++ Functions::Url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Functions
的用法示例。
在下文中一共展示了Functions::Url方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _read
Playlist::Entries PLS::_read()
{
Reader *reader = ioCtrl.rawPtr< Reader >();
Entries list;
QString playlistPath = filePath(reader->getUrl());
if (playlistPath.startsWith("file://"))
playlistPath.remove(0, 7);
else
playlistPath.clear();
const QList< QByteArray > playlistLines = readLines();
for (int i = 0; i < playlistLines.count(); ++i)
{
const QByteArray &line = playlistLines[i];
if (line.isEmpty())
continue;
int idx = line.indexOf('=');
if (idx < 0)
continue;
int number_idx = -1;
for (int i = 0; i < line.length(); ++i)
{
if (line[i] == '=')
break;
if (line[i] >= '0' && line[i] <= '9')
{
number_idx = i;
break;
}
}
if (number_idx == -1)
continue;
QByteArray key = line.left(number_idx);
QByteArray value = line.mid(idx+1);
int entry_idx = line.mid(number_idx, idx - number_idx).toInt() - 1;
prepareList(&list, entry_idx);
if (entry_idx < 0 || entry_idx > list.size() - 1)
continue;
if (key == "File")
list[entry_idx].url = Url(value, playlistPath);
else if (key == "Title")
list[entry_idx].name = value.replace('\001', '\n');
else if (key == "Length")
list[entry_idx].length = value.toInt();
else if (key == "QMPlay_sel")
list[entry_idx].selected = value.toInt();
else if (key == "QMPlay_queue")
list[entry_idx].queue = value.toInt();
else if (key == "QMPlay_GID")
list[entry_idx].GID = value.toInt();
else if (key == "QMPlay_parent")
list[entry_idx].parent = value.toInt();
}
return list;
}