本文整理汇总了C++中BNode::GetNodeRef方法的典型用法代码示例。如果您正苦于以下问题:C++ BNode::GetNodeRef方法的具体用法?C++ BNode::GetNodeRef怎么用?C++ BNode::GetNodeRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BNode
的用法示例。
在下文中一共展示了BNode::GetNodeRef方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BNode
void
ActivityView::_LoadBackgroundInfo(bool watch)
{
fCachedOutline = false;
fCachedWorkspace = -1;
BPath path;
if (find_directory(B_DESKTOP_DIRECTORY, &path) == B_OK) {
BNode desktopNode = BNode(path.Path());
attr_info info;
if (desktopNode.GetAttrInfo(kDesktopAttrName, &info) != B_OK)
return;
char* buffer = new char[info.size];
if (desktopNode.ReadAttr(kDesktopAttrName, B_MESSAGE_TYPE, 0,
buffer, (size_t)info.size) == info.size) {
BMessage message;
if (message.Unflatten(buffer) == B_OK)
fBackgroundInfo = message;
}
delete[] buffer;
if (watch) {
node_ref nref;
desktopNode.GetNodeRef(&nref);
watch_node(&nref, B_WATCH_ATTR, this);
}
}
}
示例2:
/*! Tests whether this and the supplied BNode object are equal.
Two BNode objects are said to be equal if they're set to the same node,
or if they're both \c B_NO_INIT.
\param node the BNode to be compared with
\return \c true, if the BNode objects are equal, \c false otherwise
*/
bool
BNode::operator==(const BNode &node) const
{
if (fCStatus == B_NO_INIT && node.InitCheck() == B_NO_INIT)
return true;
if (fCStatus == B_OK && node.InitCheck() == B_OK) {
// compare the node_refs
node_ref ref1, ref2;
if (GetNodeRef(&ref1) != B_OK)
return false;
if (node.GetNodeRef(&ref2) != B_OK)
return false;
return (ref1 == ref2);
}
return false;
}
示例3: RescanForNewEntries
void PanelView::RescanForNewEntries()
////////////////////////////////////////////////////////////////////////
{
BDirectory dir(m_Path.String());
BNode node;
node_ref noderef;
if (dir.InitCheck()==B_OK)
{
BEntry entry;
if (dir.GetEntry(&entry)==B_OK)
{
while (dir.GetNextEntry(&entry)==B_OK)
{
node.SetTo(&entry);
node.GetNodeRef(&noderef);
if (m_CustomListView->FindItemByNodeRef(noderef)==NULL)
AddDirectoryEntry(&entry);
}
}
}
}
示例4: dir
// ---------------------------------------------------------------------------- RHTML_Options - RHTMLOptions -
RHTMLOptions::RHTMLOptions()
{
fOptions=this;
Name= new BString("Globe");
Ver = new BString("0.4.0");
Date= new BString("2004.10.21");
DefaultFont= new BFont(be_plain_font);
SettingsDir = "/boot/home/config/settings/Globe/";
// - Locale - English (Default)
LocaleDb=0;
CurrentLocale=0;
Locale= (locale**) calloc(LocaleDb,sizeof(locale));
AddLocale("English","RoGer","[email protected]");
/*
BString dir = SettingsDir;
dir << "languages/languages.rdat";
dir << "languages/languages.rdat";
FILE *f;
if( (f = fopen(dir.String(),"rt")) == NULL); else
{
int i=0;
char tmp[100];
while (feof(f)==false)
{
tmp[0]=0;
char ch=0;
i=0;
while ((ch!='\n')&&(!feof(f)))
{
fscanf(f,"%c",&ch);
tmp[i]=ch;
i++;
tmp[i]=0;
}
tmp[i-1]=0;
if (tmp!="")
{
LoadLocale(tmp);
}
}
}*/
BString path = SettingsDir;
path << "languages";
BDirectory dir(path.String());
BNode node;
node_ref noderef;
if (dir.InitCheck()==B_OK)
{
BEntry entry;
if (dir.GetEntry(&entry)==B_OK)
{
while (dir.GetNextEntry(&entry)==B_OK)
{
node.SetTo(&entry);
node.GetNodeRef(&noderef);
char *buffer = new char[255];
entry.GetName(buffer);
entry.GetName(buffer);
LoadLocale(buffer);
// AddDirectoryEntry(&entry);
}
}
}
// - FileTypes
FileTypesDb=3;
FileTypes = (filetype**) calloc(FileTypesDb,sizeof(filetype));
// - FileTypes - SIMPLE TEXT
FileTypes[0] = new filetype;
FileTypes[0]->Name= new BString("TEXT");
FileTypes[0]->KitDb=0;
FileTypes[0]->Kit = (BString**) calloc(FileTypes[0]->KitDb,sizeof(BString));
FileTypes[0]->FontColorDb=1;
FileTypes[0]->FCName = (BString**) calloc(FileTypes[0]->FontColorDb,sizeof(BString));
FileTypes[0]->Font = (rfont**) calloc(FileTypes[0]->FontColorDb,sizeof(rfont));
FileTypes[0]->Color = (rgb_color**) calloc(FileTypes[0]->FontColorDb,sizeof(rgb_color));
FileTypes[0]->FCName[0]= new BString("Text");
font_family family;
font_style style;
float size;
be_plain_font->GetFamilyAndStyle(&family,&style);
size=be_plain_font->Size();
FileTypes[0]->Font[0]= new rfont;
FileTypes[0]->Font[0]->Family.SetTo("Default font");
FileTypes[0]->Font[0]->Style.SetTo("Default style");
FileTypes[0]->Font[0]->Size=-1;
FileTypes[0]->Color[0]= new rgb_color;
//.........这里部分代码省略.........