本文整理汇总了C++中BVolume::KnowsAttr方法的典型用法代码示例。如果您正苦于以下问题:C++ BVolume::KnowsAttr方法的具体用法?C++ BVolume::KnowsAttr怎么用?C++ BVolume::KnowsAttr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BVolume
的用法示例。
在下文中一共展示了BVolume::KnowsAttr方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
status_t
CDDBQuery::_OpenContentFile(const int32 &discID)
{
// Makes sure that the lookup has a valid file to work with for the CD
// content. Returns true if there is an existing file, false if a lookup is
// required.
BFile file;
BString predicate;
predicate << "CD:key == " << discID;
entry_ref ref;
BVolumeRoster roster;
BVolume volume;
roster.Rewind();
while (roster.GetNextVolume(&volume) == B_OK) {
if (volume.IsReadOnly() || !volume.IsPersistent() || !volume.KnowsAttr()
|| !volume.KnowsQuery())
continue;
// make sure the volume we are looking at is indexed right
fs_create_index(volume.Device(), "CD:key", B_INT32_TYPE, 0);
BQuery query;
query.SetVolume(&volume);
query.SetPredicate(predicate.String());
if (query.Fetch() != B_OK)
continue;
if (query.GetNextRef(&ref) == B_OK)
break;
}
status_t status = fCDData.Load(ref);
if (status == B_NO_INIT) {
// We receive this error when the Load() function couldn't load the
// track times This just means that we get it from the SCSI data given
// to us in SetToCD
vector<CDAudioTime> times;
GetTrackTimes(&fSCSIData,times);
for (int32 i = 0; i < fCDData.CountTracks(); i++) {
CDAudioTime *item = fCDData.TrackTimeAt(i);
*item = times[i + 1] - times[i];
}
status = B_OK;
}
return status;
}
示例2:
void
TTracker::InstallIndices()
{
BVolumeRoster roster;
BVolume volume;
roster.Rewind();
while (roster.GetNextVolume(&volume) == B_OK) {
if (volume.IsReadOnly() || !volume.IsPersistent()
|| !volume.KnowsAttr() || !volume.KnowsQuery())
continue;
InstallIndices(volume.Device());
}
}
示例3: VolRootMessage
bool
FolderShaper::IsFolderUntouchable(uint32 purpose, const entry_ref * a_ref)
{
// system directories
if (IsItThisFolder(a_ref, B_DESKTOP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_TRASH_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_APPS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_PREFERENCES_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_SYSTEM_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_SERVERS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_APPS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_BIN_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_ETC_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_DOCUMENTATION_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_BEOS_PREFERENCES_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SERVERS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_BIN_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_ETC_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DOCUMENTATION_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SETTINGS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_DEVELOP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_LOG_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_SPOOL_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_TEMP_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_SYSTEM_VAR_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_CONFIG_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_ADDONS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_BOOT_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_FONTS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_LIB_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_SETTINGS_DIRECTORY)) return SysDirMessage(a_ref);
if (IsItThisFolder(a_ref, B_USER_DESKBAR_DIRECTORY)) return SysDirMessage(a_ref);
// volume roots
BVolumeRoster vol_roster;
BVolume volume;
BDirectory vol_dir;
BEntry vol_entry;
entry_ref vol_ref;
while (vol_roster.GetNextVolume(& volume) == B_OK)
{
volume.GetRootDirectory(& vol_dir);
vol_dir.GetEntry(& vol_entry);
vol_entry.GetRef(& vol_ref);
if (*a_ref == vol_ref)
return VolRootMessage(a_ref);
}
// target does not support attributes
if (volume.SetTo(a_ref->device) != B_OK)
{
// message
return true;
}
if(! volume.KnowsAttr())
{
char volname[B_FILE_NAME_LENGTH];
volume.GetName(volname);
return NoAttributesMessage(purpose, a_ref, volname);
}
// and perhaps returns something for the BAlert
return false;
}