xref: /haiku/docs/develop/kits/support/usecases/BStringUseCases.html (revision cbe0a0c436162d78cc3f92a305b64918c839d079)
1<!-- saved from url=(0022)http://internet.e-mail -->
2<HTML>
3<HEAD>
4<TITLE>BString Use Cases and Implementation Details</TITLE>
5</HEAD>
6
7<BODY BGCOLOR="white" LINK="#000067" VLINK="#000067" ALINK="#0000FF">
8
9<FONT FACE="Verdana,Arial,Helvetica,sans-serif" SIZE="-1">
10
11<H1>BString Use Cases and Implementation Details:</H1>
12
13<P>This document describes the BString interface and some basics of how it is implemented.
14The document has the following sections:</P>
15
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>
21
22<A NAME="interface"></A><H2>BString Interface:</H2>
23
24<P>The BString is as string allocation and manipulation class. The object allocates and deallocates
25memory for you so the buffer will always be "big enough" to contain the data.
26BString provides a number of charachter search, comparison, and manipulation functions in
27a variety of flavors. The best source of information about the BString class can be found
28<A HREF="https://www.haiku-os.org/legacy-docs/bebook/BString.html">here in the Be Book</A>.
29</P>
30
31<A NAME="usecases"></A><H2>BString Use Cases:</H2>
32
33<P>The following use cases cover the BString functionality:</P>
34
35<OL>
36
37<LI><P><B>Construction 1:</B> A BString can be created with an empty constructor.
38This way the created BString is empty.</P></LI>
39
40<LI><P><B>Construction 2:</B> You can create a BString object with a const char pointer as
41parameter. After the construction, the BString object contains a copy of the string pointed
42by the const char pointer.</P></LI>
43
44<LI><P><B>Construction 3:</B> BString can be created using a copy constructor.
45The parameter is another BString. After the construction, your BString will contain a
46copy of the other BString.</P></LI>
47
48<LI><P><B>Construction 4:</B> You can create a BString object with a const char pointer as
49parameter and an int32 parameter, which specifies the maximum bytes BString will consider.
50After the construction, the BString object contains a maximum of bytes (specified by the int32
51parameter) of the string pointed by the pointer.</P></LI>
52
53<LI><P><B>Destruction:</B> The BString destructor frees the allocated memory.</P></LI>
54
55</OL>
56
57<A NAME="implement"></A><H2>BString Implementation:</H2>
58
59
60</BODY>
61</HTML>
62