当前位置: 首页>>代码示例>>C++>>正文


C++ BDirectory::IsRootDirectory方法代码示例

本文整理汇总了C++中BDirectory::IsRootDirectory方法的典型用法代码示例。如果您正苦于以下问题:C++ BDirectory::IsRootDirectory方法的具体用法?C++ BDirectory::IsRootDirectory怎么用?C++ BDirectory::IsRootDirectory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BDirectory的用法示例。


在下文中一共展示了BDirectory::IsRootDirectory方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: EvaluateRef

status_t TElementsSorter::EvaluateRef(entry_ref &ref)
{
	struct stat st;
	BEntry entry;

	// Can we create a BEntry?
	if (entry.SetTo(&ref, false) != B_OK)
		return B_ERROR;

	// Can we get a BStatable?
	if (entry.GetStat(&st) != B_OK)
		return B_ERROR;

	// Is it a SymLink?
	if (S_ISLNK(st.st_mode))
		return HandleLink(ref, st);
	// How about a File?
	else if (S_ISREG(st.st_mode))
		return HandleFile(ref, st);
	// A Directory?
	else if (S_ISDIR(st.st_mode)) {
		BDirectory dir;
		if (dir.SetTo(&ref) != B_OK)
			return B_ERROR;

		if (dir.IsRootDirectory())
			return HandleVolume(ref, st, dir);
		else
			return HandleDirectory(ref, st, dir);
	}

	// No luck
	return B_ERROR;
}
开发者ID:Barrett17,项目名称:UltraDV,代码行数:34,代码来源:TElementsSorter.cpp

示例2: EvaluateRef

status_t TQueueDialog::EvaluateRef(entry_ref &ref) 
{
	struct stat st; 
	BEntry 		entry; 
	
	// Can we create a BEntry?
	if (entry.SetTo(&ref, false) != B_OK)
	{
		ERROR("TQueueDialog::HandleRefsMessage() - BEntry SetTo() failure -\n");
		return B_ERROR; 
	}
		
	// Can we get a BStatable?
	if (entry.GetStat(&st) != B_OK) 
	{
		ERROR("TQueueDialog::HandleRefsMessage() - BEntry GetStat() failure -\n");
		return B_ERROR; 
	}
		
	// Is it a SymLink?
	if (S_ISLNK(st.st_mode)) 
		return HandleLink(ref, st);
	// How about a File?
	else if (S_ISREG(st.st_mode)) 
		return HandleFile(ref, st); 
	// A Directory?
	else if (S_ISDIR(st.st_mode)) 
	{
		BDirectory dir; 
		if (dir.SetTo(&ref) != B_OK)
		{
			return B_ERROR;
		}
			
		if (dir.IsRootDirectory()) 
			return HandleVolume(ref, st, dir); 
		else 
			return HandleDirectory(ref, st, dir); 
	} 
	
	// No luck
	return B_ERROR;
} 
开发者ID:HaikuArchives,项目名称:UltraEncode,代码行数:43,代码来源:TQueueDialog.cpp

示例3: str

status_t
PDirectory::GetProperty(const char *name, PValue *value, const int32 &index) const
{
	if (!name || !value)
		return B_ERROR;
	
	BString str(name);
	PProperty *prop = FindProperty(name,index);
	if (!prop)
		return B_NAME_NOT_FOUND;
	
	BDirectory *backend = (BDirectory*)fBackend;
	if (str.ICompare("IsRoot") == 0)
		((BoolProperty*)prop)->SetValue(backend->IsRootDirectory());
	else if (str.ICompare("EntryCount") == 0)
		((IntProperty*)prop)->SetValue(backend->CountEntries());
	else
	{
		return PNode::GetProperty(name, value, index);
	}

	return prop->GetValue(value);
}
开发者ID:HaikuArchives,项目名称:PDesigner,代码行数:23,代码来源:PDirectory.cpp

示例4: opener

void
Model::ResetIconFrom()
{
	BModelOpener opener(this);

	if (InitCheck() != B_OK)
		return;

	// mirror the logic from FinishSettingUpType
	if ((fBaseType == kDirectoryNode || fBaseType == kVolumeNode
			|| fBaseType == kTrashNode || fBaseType == kDesktopNode)
		&& !CheckNodeIconHint(fNode)) {
		BDirectory* directory = dynamic_cast<BDirectory*>(fNode);
		if (WellKnowEntryList::Match(NodeRef()) > (directory_which)-1) {
			fIconFrom = kTrackerSupplied;
			return;
		} else if (directory != NULL && directory->IsRootDirectory()) {
			fIconFrom = kVolume;
			return;
		}
	}
	fIconFrom = kUnknownSource;
}
开发者ID:looncraz,项目名称:haiku,代码行数:23,代码来源:Model.cpp


注:本文中的BDirectory::IsRootDirectory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。