本文整理汇总了C++中VolumeManager::LoadDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ VolumeManager::LoadDirectory方法的具体用法?C++ VolumeManager::LoadDirectory怎么用?C++ VolumeManager::LoadDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VolumeManager
的用法示例。
在下文中一共展示了VolumeManager::LoadDirectory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: securityContextDeleter
// Mount
status_t
ClientVolume::Mount(UserSecurityContext* securityContext, Share* share)
{
if (!securityContext || !share)
return B_BAD_VALUE;
ObjectDeleter<UserSecurityContext> securityContextDeleter(securityContext);
if (IsMounted())
return B_BAD_VALUE;
fSecurityContext = securityContext;
securityContextDeleter.Detach();
fShare = share;
fShare->AcquireReference();
dev_t volumeID = share->GetVolumeID();
ino_t nodeID = share->GetNodeID();
// into root node ref
fRootNodeRef.device = volumeID;
fRootNodeRef.node = nodeID;
// get the share permissions
fSharePermissions = securityContext->GetNodePermissions(volumeID, nodeID);
// get the root directory
VolumeManager* volumeManager = VolumeManager::GetDefault();
Directory* rootDir;
status_t error = volumeManager->LoadDirectory(volumeID, nodeID, &rootDir);
if (error != B_OK)
return error;
// register with the volume manager
error = volumeManager->AddClientVolume(this);
if (error != B_OK) {
Unmount();
return error;
}
fMounted = true;
// notify the statistics manager
StatisticsManager::GetDefault()->ShareMounted(fShare,
fSecurityContext->GetUser());
return B_OK;
}
示例2:
// LoadDirectory
status_t
ClientVolume::LoadDirectory(dev_t volumeID, ino_t nodeID,
Directory** _directory)
{
if (!_directory)
return B_BAD_VALUE;
VolumeManager* volumeManager = VolumeManager::GetDefault();
// load the directory
Directory* dir;
status_t error = volumeManager->LoadDirectory(volumeID, nodeID, &dir);
if (error != B_OK)
return error;
// check, if the dir is contained by the root dir of the client volume
if (!volumeManager->DirectoryContains(GetRootDirectory(), dir, true))
return B_ENTRY_NOT_FOUND;
*_directory = dir;
return B_OK;
}