vfs: check userland buffers before reading them.
[haiku.git] / docs / develop / support / usecases / BStringUseCases.html
blob03290ca6d76b10d88d2da0b70efefcece9b9a5ba
1 <!-- saved from url=(0022)http://internet.e-mail -->
2 <HTML>
3 <HEAD>
4 <TITLE>BString Use Cases and Implementation Details</TITLE>
5 </HEAD>
7 <BODY BGCOLOR="white" LINK="#000067" VLINK="#000067" ALINK="#0000FF">
9 <FONT FACE="Verdana,Arial,Helvetica,sans-serif" SIZE="-1">
11 <H1>BString Use Cases and Implementation Details:</H1>
13 <P>This document describes the BString interface and some basics of how it is implemented.
14 The document has the following sections:</P>
16 <OL>
17 <LI><A HREF="#interface">BString Interface</A></LI>
18 <LI><A HREF="#usecases">BString Use Cases</A></LI>
19 <LI><A HREF="#implement">BString Implementation</A></LI>
20 </OL>
22 <A NAME="interface"></A><H2>BString Interface:</H2>
24 <P>The BString is as string allocation and manipulation class. The object allocates and deallocates
25 memory for you so the buffer will always be "big enough" to contain the data.
26 BString provides a number of charachter search, comparison, and manipulation functions in
27 a variety of flavors. The best source of information about the BString class can be found
28 <A HREF="file:///boot/beos/documentation/Be%20Book/The%20Support%20Kit/String.html">here in the Be Book</A>.
29 </P>
31 <A NAME="usecases"></A><H2>BString Use Cases:</H2>
33 <P>The following use cases cover the BString functionality:</P>
35 <OL>
37 <LI><P><B>Construction 1:</B> A BString can be created with an empty constructor.
38 This way the created BString is empty.</P></LI>
40 <LI><P><B>Construction 2:</B> You can create a BString object with a const char pointer as
41 parameter. After the construction, the BString object contains a copy of the string pointed
42 by the const char pointer.</P></LI>
44 <LI><P><B>Construction 3:</B> BString can be created using a copy constructor.
45 The parameter is another BString. After the construction, your BString will contain a
46 copy of the other BString.</P></LI>
48 <LI><P><B>Construction 4:</B> You can create a BString object with a const char pointer as
49 parameter and an int32 parameter, which specifies the maximum bytes BString will consider.
50 After the construction, the BString object contains a maximum of bytes (specified by the int32
51 parameter) of the string pointed by the pointer.</P></LI>
53 <LI><P><B>Destruction:</B> The BString destructor frees the allocated memory.</P></LI>
55 </OL>
57 <A NAME="implement"></A><H2>BString Implementation:</H2>
60 </BODY>
61 </HTML>