本文整理汇总了C++中DirAccess::dnext方法的典型用法代码示例。如果您正苦于以下问题:C++ DirAccess::dnext方法的具体用法?C++ DirAccess::dnext怎么用?C++ DirAccess::dnext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DirAccess
的用法示例。
在下文中一共展示了DirAccess::dnext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: scan
// scan localpath, add or update child nodes, call recursively for folder nodes
// localpath must be prefixed with Sync
bool Sync::scan(string* localpath, FileAccess* fa)
{
if (localpath->size() < localdebris.size()
|| memcmp(localpath->data(), localdebris.data(), localdebris.size())
|| (localpath->size() != localdebris.size()
&& memcmp(localpath->data() + localdebris.size(),
client->fsaccess->localseparator.data(),
client->fsaccess->localseparator.size())))
{
DirAccess* da;
string localname, name;
bool success;
da = client->fsaccess->newdiraccess();
// scan the dir, mark all items with a unique identifier
if ((success = da->dopen(localpath, fa, false)))
{
size_t t = localpath->size();
while (da->dnext(&localname))
{
name = localname;
client->fsaccess->local2name(&name);
// check if this record is to be ignored
if (client->app->sync_syncable(name.c_str(), localpath, &localname))
{
if (t)
{
localpath->append(client->fsaccess->localseparator);
}
localpath->append(localname);
// skip the sync's debris folder
if ((localpath->size() < localdebris.size())
|| memcmp(localpath->data(), localdebris.data(), localdebris.size())
|| ((localpath->size() != localdebris.size())
&& memcmp(localpath->data() + localdebris.size(),
client->fsaccess->localseparator.data(),
client->fsaccess->localseparator.size())))
{
// new or existing record: place scan result in notification queue
dirnotify->notify(DirNotify::DIREVENTS, NULL, localpath->data(), localpath->size(), true);
}
localpath->resize(t);
}
}
}
delete da;
return success;
}
else return false;
}