haiku-website/static/legacy-docs/bebook/BNodeInfo_Overview.html

76 lines
9.6 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - System Overview - The Storage Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheStorageKit_Overview.html" title="The Storage Kit" /><link rel="prev" href="BNode_Overview.html" title="BNode" /><link rel="next" href="BPath_Overview.html" title="BPath" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BNode_Overview.html" title="BNode"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheStorageKit_Overview.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BPath_Overview.html" title="BPath"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - System Overview - The Storage Kit</div></div><div id="headerB">Prev: <a href="BNode_Overview.html">BNode</a>  Up: <a href="TheStorageKit_Overview.html">The Storage Kit</a>  Next: <a href="BPath_Overview.html">BPath</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BNodeInfo_Overview"></a>BNodeInfo</h2></div></div></div><a id="id609445" class="indexterm"></a><p>
<code class="classname">BNodeInfo</code> provides file type information about a particular node;
specifically:
</p><ul class="itemizedlist"><li><p>
The (MIME) file type.
</p></li><li><p>
The node's icons, including the node-specific icon that the <span class="application">Tracker</span>
displays.
</p></li><li><p>
The "preferred app"; this is the application that's used to access
the node's contents.
</p></li></ul><p>
Except for the <span class="application">Tracker</span> icon, all this information can also be set through
the <code class="classname">BNodeInfo</code> class. None of the information is passed on to the File
Type database; if you want to record a node's file type information with
the database, you have to create a
<a class="link" href="BMimeType.html" title="BMimeType"><code class="classname">BMimeType</code></a> object (based on the node's
file type) and go from there.
</p><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BNodeInfo_Initialization"></a>Initialization</h3></div></div></div><p>
You initialize a <code class="classname">BNodeInfo</code> object by passing it a
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a> object. Although
you can pass any flavor of node, you typically only care about files;
passing a <a class="link" href="BFile.html" title="BFile"><code class="classname">BFile</code></a>
object (or any subclass of
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a>) is, of course,
acceptable. The <code class="classname">BNodeInfo</code> object maintains its own pointer to the BNode
you pass in. You don't have to avoid touching the
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a> while a <code class="classname">BNodeInfo</code>
is looking at it (or changing it); the only thing you shouldn't do is
delete the <a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a>.
</p><p>
<code class="classname">BNodeInfo</code> doesn't care if the
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a> is locked—there's no particular
reason to lock the
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a> before passing it in,
but the <code class="classname">BNodeInfo</code> won't
balk if you do. If you pass in a
<a class="link" href="BFile.html" title="BFile"><code class="classname">BFile</code></a> object,
<code class="classname">BNodeInfo</code> does not obey
the <a class="link" href="BFile.html" title="BFile"><code class="classname">BFile</code></a>'s
read/write flags. For example, you can set the node info for
a <a class="link" href="BFile.html" title="BFile"><code class="classname">BFile</code></a>
even if you've opened it in read-only mode.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BNodeInfo_Node_Info_Equals_Attributes"></a>Node Info Equals Attributes</h3></div></div></div><p>
The <code class="classname">BNodeInfo</code> class does nothing more than look in a node's attributes
for the information it sets or gets. The attribute names for the various
information particles are given in the function descriptions, below. If
you want, you can bypass <code class="classname">BNodeInfo</code> and get the node information directly
by passing the attribute names to
<a class="link" href="BNode.html" title="BNode"><code class="classname">BNode</code></a>'s
<a class="link" href="BNode.html#BNode_ReadAttr" title="ReadAttr(), WriteAttr(), RemoveAttr()"><code class="methodname">ReadAttr()</code></a> and
<a class="link" href="BNode.html#BNode_WriteAttr"><code class="methodname">WriteAttr()</code></a>
functions.
</p><p>
The one exception to this is
<a class="link" href="BNodeInfo.html#BNodeInfo_GetTrackerIcon"><code class="methodname">GetTrackerIcon()</code></a>: This function starts by
looking in the node's attributes, but then it goes out hunting if it has
to (if the icon isn't found in the attributes).
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BNodeInfo_BAppFileInfo"></a>BAppFileInfo</h3></div></div></div><p>
<code class="classname">BNodeInfo</code> has a single subclass:
<a class="link" href="BAppFileInfo.html" title="BAppFileInfo"><code class="classname">BAppFileInfo</code></a>.
You use a <a class="link" href="BAppFileInfo.html" title="BAppFileInfo"><code class="classname">BAppFileInfo</code></a>
object to get more information about a specific executable image (file).
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BNodeInfo_Errors"></a>Errors</h3></div></div></div><p>
Unlike most of the other Storage Kit classes, when you ask a <code class="classname">BNodeInfo</code> to
retrieve some information by reference, the object doesn't clear the
reference argument if it fails. Because of this, you should always check
the error code that's returned by the <code class="methodname">Get…()</code> functions.
</p></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BNode_Overview.html">BNode</a>  Up: <a href="TheStorageKit_Overview.html">The Storage Kit</a>  Next: <a href="BPath_Overview.html">BPath</a> </div><div id="footerB"><div id="footerBL"><a href="BNode_Overview.html" title="BNode"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheStorageKit_Overview.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BPath_Overview.html" title="BPath"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>