106 lines
18 KiB
HTML
106 lines
18 KiB
HTML
<?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 - Classes And Methods - 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.html" title="The Storage Kit" /><link rel="prev" href="BSymLink.html" title="BSymLink" /><link rel="next" href="BVolumeRoster.html" title="BVolumeRoster" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BSymLink.html" title="BSymLink"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheStorageKit.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="BVolumeRoster.html" title="BVolumeRoster"><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 - Classes And Methods - The Storage Kit</div></div><div id="headerB">Prev: <a href="BSymLink.html">BSymLink</a> Up: <a href="TheStorageKit.html">The Storage Kit</a> Next: <a href="BVolumeRoster.html">BVolumeRoster</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="BVolume"></a>BVolume</h2></div></div></div><a id="id1254634" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td>None</td></tr><tr><td>Mix-in Classes:</td><td>None</td></tr><tr><td>Declared In:</td><td><code class="filename">storage/Volume.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libbe.so</code></td></tr><tr><td>Allocation:</td><td>–</td></tr></tbody></table></td><td>
|
||
<a class="link overview" href="BVolume_Overview.html" title="BVolume">Class Overview</a>
|
||
<div class="toc"><ul><li><span class="section"><a href="BVolume.html#BVolume_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BVolume.html#BVolume_Member_Functions">Member Functions</a></span></li><li><span class="section"><a href="BVolume.html#BVolume_Operators">Operators</a></span></li></ul></div>
|
||
</td></tr></tbody></table></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="BVolume_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_Constructor"></a>BVolume()</h4></div></div></div><div class="synopsisgroup">
|
||
<code class="constructorsynopsis cpp"><span class="methodname">BVolume</span>();</code>
|
||
|
||
<code class="constructorsynopsis cpp"><span class="methodname">BVolume</span>(<span class="methodparam"><span class="type">dev_t </span><span class="parameter">device</span></span>);</code>
|
||
|
||
<code class="constructorsynopsis cpp"><span class="methodname">BVolume</span>(<span class="methodparam"><span class="type">BVolume& </span><span class="parameter">volume</span></span>);</code>
|
||
</div><p>
|
||
Creates a new <code class="classname">BVolume</code> object and initializes it according to the
|
||
argument. The status of the initialization is recorded by the
|
||
<a class="link" href="BVolume.html#BVolume_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a>
|
||
function.
|
||
</p><ul class="itemizedlist"><li><p>
|
||
The default constructor does nothing and sets
|
||
<a class="link" href="BVolume.html#BVolume_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a> to
|
||
<code class="constant">B_NO_INIT</code>.
|
||
</p></li><li><p>
|
||
The device constructor sets the <code class="classname">BVolume</code> to point to the volume
|
||
represented by the argument. See the
|
||
<a class="link" href="BVolume.html#BVolume_SetTo" title="SetTo(), Unset()"><code class="methodname">SetTo()</code></a>
|
||
function for status codes.
|
||
</p></li><li><p>
|
||
The copy constructor sets the object to point to the same device as
|
||
does the argument.
|
||
</p></li></ul></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_Destructor"></a>~BVolume</h4></div></div></div><code class="destructorsynopsis cpp"><span class="methodname">~BVolume</span>();</code><p>
|
||
Destroys the <code class="classname">BVolume</code> object.
|
||
</p></div></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="BVolume_Member_Functions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_Capacity"></a><a id="BVolume_FreeBytes"></a>
|
||
Capacity(), FreeBytes()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">off_t </span><span class="methodname">Capacity</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">off_t </span><span class="methodname">FreeBytes</span>() <span class="modifier">const</span>;</code><p>
|
||
Returns the volume's total storage capacity and the amount of storage
|
||
that's currently unused. Both measurements are in bytes.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_Device"></a>Device()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">dev_t </span><span class="methodname">Device</span>() <span class="modifier">const</span>;</code><p>
|
||
Returns the object's <span class="type">dev_t</span> number.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_GetIcon"></a>GetIcon()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetIcon</span>(<span class="methodparam"><span class="type"><a class="link" href="BBitmap.html" title="BBitmap"><code class="classname">BBitmap</code></a>* </span><span class="parameter">icon</span></span>,<br /> <span class="methodparam"><span class="type">icon_size </span><span class="parameter">which</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Returns the volume's icon in <code class="parameter">icon</code>. which specifies the icon to retrieve,
|
||
either <code class="constant">B_MINI_ICON</code> (16x16) or <code class="constant">B_LARGE_ICON</code> (32x32).
|
||
</p><p>
|
||
See also:
|
||
<a class="link" href="TheStorageKit_Functions.html#get_device_icon" title="get_device_icon()"><code class="function">get_device_icon()</code></a>
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_GetName"></a>GetName()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetName</span>(<span class="methodparam"><span class="type">char* </span><span class="parameter">buffer</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Copies the name of the volume into <code class="parameter">buffer</code>.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_GetRootDirectory"></a>GetRootDirectory()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetRootDirectory</span>(<span class="methodparam"><span class="type"><a class="link" href="BDirectory.html" title="BDirectory"><code class="classname">BDirectory</code></a>* </span><span class="parameter">dir</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Initializes <code class="parameter">dir</code> (which must be allocated) to refer to the volume's "root
|
||
directory." The root directory stands at the "root" of the volume's file
|
||
hierarchy. Note that this isn't necessarily the root of the entire file
|
||
hierarchy.
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_InitCheck"></a>InitCheck()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">InitCheck</span>() <span class="modifier">const</span>;</code><p>
|
||
Returns the status of the last initialization (from either the
|
||
constructor or
|
||
<a class="link" href="BVolume.html#BVolume_SetTo" title="SetTo(), Unset()"><code class="methodname">SetTo()</code></a>).
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_IsPersistent"></a><a id="BVolume_IsRemovable"></a>
|
||
<a id="BVolume_IsReadOnly"></a>
|
||
<a id="BVolume_IsShared"></a>
|
||
IsPersistent(), IsRemovable(), IsReadOnly(), IsShared()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsPersistent</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsRemovable</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsReadOnly</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">IsShared</span>() <span class="modifier">const</span>;</code><p>
|
||
These functions answer media-related questions about the volume:
|
||
</p><ul class="itemizedlist"><li><p>
|
||
<code class="methodname">IsPersistent()</code>. Is the storage persistent (such as on a floppy or
|
||
hard disk)?
|
||
</p></li><li><p>
|
||
<code class="methodname">IsRemovable()</code>. Can the media be removed?
|
||
</p></li><li><p>
|
||
<code class="methodname">IsReadOnly()</code>. Can it be read but not written to?
|
||
</p></li><li><p>
|
||
<code class="methodname">IsShared()</code>. Is it accessed through the network (as opposed to being
|
||
directly connected to this computer)?
|
||
</p></li></ul></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_KnowsAttr"></a><a id="BVolume_KnowsMime"></a>
|
||
<a id="BVolume_KnowsQuery"></a>
|
||
KnowsAttr(), KnowsMime(), KnowsQuery()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">KnowsAttr</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">KnowsMime</span>() <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">KnowsQuery</span>() <span class="modifier">const</span>;</code><p>
|
||
These functions answer questions about the file system on the volume:
|
||
</p><ul class="itemizedlist"><li><p>
|
||
<code class="methodname">KnowsAttr()</code>. Do its files accept attributes?
|
||
</p></li><li><p>
|
||
<code class="methodname">KnowsMime()</code>. Does it use MIME to type files?
|
||
</p></li><li><p>
|
||
<code class="methodname">KnowsQuery()</code>. Can it respond to queries?
|
||
</p></li></ul></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_SetTo"></a><a id="BVolume_Unset"></a>
|
||
SetTo(), Unset()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">SetTo</span>(<span class="methodparam"><span class="type">dev_t </span><span class="parameter">dev</span></span>);</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">Unset</span>();</code><p>
|
||
<code class="methodname">SetTo()</code> initializes the <code class="classname">BVolume</code>
|
||
object to represent the volume (device)
|
||
identified by the argument.
|
||
</p><p>
|
||
<code class="methodname">Unset()</code> uninitializes the <code class="classname">BVolume</code>.
|
||
</p></div></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="BVolume_Operators"></a>Operators</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_operator_equals"></a>= (assignment)</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">BVolume& </span><span class="methodname">operator =</span>(<span class="methodparam"><span class="modifier">const </span><span class="type"><a class="link" href="BEntry.html" title="BEntry"><code class="classname">BEntry</code></a>& </span><span class="parameter">volume</span></span>);</code><p>
|
||
In the expression
|
||
</p><pre class="programlisting example cpp"><code class="classname">BVolume</code> <code class="varname">a</code> = <code class="varname">b</code>;</pre><p>
|
||
<code class="classname">BVolume</code> <code class="varname">a</code> is initialized to
|
||
refer to the same volume as <code class="varname">b</code>. To gauge the
|
||
success of the assignment, you should call
|
||
<a class="link" href="BVolume.html#BVolume_InitCheck" title="InitCheck()"><code class="methodname">InitCheck()</code></a> immediately
|
||
afterwards. Assigning a <code class="classname">BVolume</code> to itself is safe.
|
||
</p><p>
|
||
Assigning from an uninitialized <code class="classname">BVolume</code> is "successful": The assigned-to
|
||
<code class="classname">BVolume</code> will also be uninitialized (<code class="constant">B_NO_INIT</code>).
|
||
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolume_operator_equality"></a><a id="BVolume_operator_inequality"></a>
|
||
== , != (comparison)</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">operator ==</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">BVolume& </span><span class="parameter">volume</span></span>) <span class="modifier">const</span>;</code><code class="methodsynopsis cpp"><span class="type">bool </span><span class="methodname">operator !=</span>(<span class="methodparam"><span class="modifier">const </span><span class="type">BVolume& </span><span class="parameter">volume</span></span>) <span class="modifier">const</span>;</code><p>
|
||
Two <code class="classname">BVolume</code> objects are said to be equal if they refer to the same
|
||
volume, or if they're both uninitialized.
|
||
</p></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BSymLink.html">BSymLink</a> Up: <a href="TheStorageKit.html">The Storage Kit</a> Next: <a href="BVolumeRoster.html">BVolumeRoster</a> </div><div id="footerB"><div id="footerBL"><a href="BSymLink.html" title="BSymLink"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheStorageKit.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="BVolumeRoster.html" title="BVolumeRoster"><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>
|