本文整理汇总了C++中BVolume::InitCheck方法的典型用法代码示例。如果您正苦于以下问题:C++ BVolume::InitCheck方法的具体用法?C++ BVolume::InitCheck怎么用?C++ BVolume::InitCheck使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BVolume
的用法示例。
在下文中一共展示了BVolume::InitCheck方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BQuery
bool
GeneralView::_CanFindServer(entry_ref* ref)
{
// Try searching with be_roster
if (be_roster->FindApp(kNotificationServerSignature, ref) == B_OK)
return true;
// Try with a query and take the first result
BVolumeRoster vroster;
BVolume volume;
char volName[B_FILE_NAME_LENGTH];
vroster.Rewind();
while (vroster.GetNextVolume(&volume) == B_OK) {
if ((volume.InitCheck() != B_OK) || !volume.KnowsQuery())
continue;
volume.GetName(volName);
BQuery *query = new BQuery();
query->SetPredicate("(BEOS:APP_SIG==\""kNotificationServerSignature"\")");
query->SetVolume(&volume);
query->Fetch();
if (query->GetNextRef(ref) == B_OK)
return true;
}
return false;
}
示例2: volume
/*! \brief Finds a BPartition by mount path.
*/
status_t
BDiskDeviceRoster::FindPartitionByMountPoint(const char* mountPoint,
BDiskDevice* device, BPartition** _partition)
{
BVolume volume(dev_for_path(mountPoint));
if (volume.InitCheck() == B_OK
&& FindPartitionByVolume(volume, device, _partition))
return B_OK;
return B_ENTRY_NOT_FOUND;
}
示例3: BVolume
// SymLink handling:
// symlink pose uses the resolved model to retrieve the icon, if not broken
// everything else, like the attributes, etc. is retrieved directly from the
// symlink itself
BPose::BPose(Model* model, BPoseView* view, uint32 clipboardMode,
bool selected)
:
fModel(model),
fWidgetList(4, true),
fClipboardMode(clipboardMode),
fPercent(-1),
fSelectionTime(0),
fIsSelected(selected),
fHasLocation(false),
fNeedsSaveLocation(false),
fListModeInited(false),
fWasAutoPlaced(false),
fBrokenSymLink(false),
fBackgroundClean(false)
{
CreateWidgets(view);
if (model->IsVolume()) {
fs_info info;
dev_t device = model->NodeRef()->device;
BVolume* volume = new BVolume(device);
if (volume->InitCheck() == B_OK
&& fs_stat_dev(device, &info) == B_OK) {
// Philosophy here:
// Bars go on all read/write volumes
// Exceptions: Not on CDDA
if (strcmp(info.fsh_name,"cdda") != 0
&& !volume->IsReadOnly()) {
// The volume is ok and we want space bars on it
gPeriodicUpdatePoses.AddPose(this, view,
_PeriodicUpdateCallback, volume);
if (TrackerSettings().ShowVolumeSpaceBar())
fPercent = CalcFreeSpace(volume);
} else
delete volume;
} else
delete volume;
}
}
示例4:
/*! \brief Returns whether two BVolume objects are equal.
Two volume objects are said to be equal, if they either are both
uninitialized, or both are initialized and refer to the same volume.
\param volume The object to be compared with.
\result \c true, if this object and the supplied one are equal, \c false
otherwise.
*/
bool
BVolume::operator==(const BVolume &volume) const
{
return ((InitCheck() != B_OK && volume.InitCheck() != B_OK)
|| fDevice == volume.fDevice);
}