1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3
<title>Ipelib: IpeString class Reference</title>
4
<link href="doxygen.css" rel="stylesheet" type="text/css">
6
<!-- Generated by Doxygen 1.3.4 -->
7
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="functions.html">Class Members</a></div>
8
<h1>IpeString Class Reference<br>
10
[<a class="el" href="group__base.html">Ipe Base</a>]</small>
11
</h1>Strings and buffers.
12
<a href="#_details">More...</a>
14
<a href="class_ipe_string-members.html">List of all members.</a><h2>Public Member Functions</h2>
16
<li><a class="anchor" name="a1" doxytag="IpeString::IpeString" ></a>
17
<b>IpeString</b> (const char *str)
18
<li><a class="anchor" name="a2" doxytag="IpeString::IpeString" ></a>
19
<b>IpeString</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs)
20
<li><a class="anchor" name="a3" doxytag="IpeString::IpeString" ></a>
21
<b>IpeString</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs, int index, int len)
22
<li><a class="anchor" name="a4" doxytag="IpeString::operator=" ></a>
23
<a class="el" href="class_ipe_string.html">IpeString</a> & <b>operator=</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs)
24
<li>char <a class="el" href="class_ipe_string.html#a6">operator[]</a> (int i) const
25
<li>bool <a class="el" href="class_ipe_string.html#a7">empty</a> () const
26
<li>const char * <a class="el" href="class_ipe_string.html#a8">data</a> () const
27
<li>int <a class="el" href="class_ipe_string.html#a9">size</a> () const
28
<li>void <a class="el" href="class_ipe_string.html#a10">operator+=</a> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs)
29
<li>void <a class="el" href="class_ipe_string.html#a11">operator+=</a> (char ch)
30
<li><a class="el" href="class_ipe_string.html">IpeString</a> <a class="el" href="class_ipe_string.html#a12">substr</a> (int i, int len=-1) const
31
<li>bool <a class="el" href="class_ipe_string.html#a13">operator!=</a> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs) const
32
<li><a class="anchor" name="a14" doxytag="IpeString::erase" ></a>
34
<li><a class="anchor" name="a15" doxytag="IpeString::append" ></a>
35
void <b>append</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs)
36
<li><a class="anchor" name="a16" doxytag="IpeString::append" ></a>
37
void <b>append</b> (char ch)
38
<li><a class="anchor" name="a17" doxytag="IpeString::operator==" ></a>
39
bool <b>operator==</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs) const
40
<li><a class="anchor" name="a18" doxytag="IpeString::operator<" ></a>
41
bool <b>operator<</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs) const
42
<li><a class="anchor" name="a19" doxytag="IpeString::operator+" ></a>
43
<a class="el" href="class_ipe_string.html">IpeString</a> <b>operator+</b> (const <a class="el" href="class_ipe_string.html">IpeString</a> &rhs) const
44
<li><a class="anchor" name="a20" doxytag="IpeString::CString" ></a>
45
const char * <b>CString</b> () const
47
<hr><a name="_details"></a><h2>Detailed Description</h2>
50
IpeString is is an implicitly shared UTF-8 encoded string. It is designed to be efficient for strings of arbitrary length, and supposed to be passed by value (the size of IpeString is a single pointer). Sharing is implicit---the string creates its own representation as soon as it is modified. (Before I can publicize the Unicode support, I have to find the best way of getting UTF-8 encoded text through Pdflatex.)<p>
51
Ipe is not using the STL string type because the C++ standard does neither guarantee that passing by value is efficient, nor that std::string is efficient for very long strings (although in practice that is probably true). However, IpeString is designed to be plug-in compatible with std::string, so Ipe can switch any time it is deemed appropriate (in particular, unlike the rest of Ipe, IpeString uses lower-case member names!).
53
<hr><h2>Member Function Documentation</h2>
54
<a class="anchor" name="a6" doxytag="IpeString::operator[]" ></a><p>
55
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
58
<table cellpadding="0" cellspacing="0" border="0">
60
<td class="md" nowrap valign="top"> char IpeString::operator[] </td>
61
<td class="md" valign="top">( </td>
62
<td class="md" nowrap valign="top">int </td>
63
<td class="mdname1" valign="top" nowrap> <em>i</em> </td>
64
<td class="md" valign="top"> ) </td>
65
<td class="md" nowrap> const<code> [inline]</code></td>
72
<table cellspacing=5 cellpadding=0 border=0>
80
Return character at index i.
85
<a class="anchor" name="a7" doxytag="IpeString::empty" ></a><p>
86
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
89
<table cellpadding="0" cellspacing="0" border="0">
91
<td class="md" nowrap valign="top"> bool IpeString::empty </td>
92
<td class="md" valign="top">( </td>
93
<td class="mdname1" valign="top" nowrap> </td>
94
<td class="md" valign="top"> ) </td>
95
<td class="md" nowrap> const<code> [inline]</code></td>
102
<table cellspacing=5 cellpadding=0 border=0>
115
<a class="anchor" name="a8" doxytag="IpeString::data" ></a><p>
116
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
119
<table cellpadding="0" cellspacing="0" border="0">
121
<td class="md" nowrap valign="top"> const char* IpeString::data </td>
122
<td class="md" valign="top">( </td>
123
<td class="mdname1" valign="top" nowrap> </td>
124
<td class="md" valign="top"> ) </td>
125
<td class="md" nowrap> const<code> [inline]</code></td>
132
<table cellspacing=5 cellpadding=0 border=0>
140
Return read-only pointer to the data.
145
<a class="anchor" name="a9" doxytag="IpeString::size" ></a><p>
146
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
149
<table cellpadding="0" cellspacing="0" border="0">
151
<td class="md" nowrap valign="top"> int IpeString::size </td>
152
<td class="md" valign="top">( </td>
153
<td class="mdname1" valign="top" nowrap> </td>
154
<td class="md" valign="top"> ) </td>
155
<td class="md" nowrap> const<code> [inline]</code></td>
162
<table cellspacing=5 cellpadding=0 border=0>
170
Return number of bytes in the string.
175
<a class="anchor" name="a10" doxytag="IpeString::operator+=" ></a><p>
176
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
179
<table cellpadding="0" cellspacing="0" border="0">
181
<td class="md" nowrap valign="top"> void IpeString::operator+= </td>
182
<td class="md" valign="top">( </td>
183
<td class="md" nowrap valign="top">const <a class="el" href="class_ipe_string.html">IpeString</a> & </td>
184
<td class="mdname1" valign="top" nowrap> <em>rhs</em> </td>
185
<td class="md" valign="top"> ) </td>
186
<td class="md" nowrap><code> [inline]</code></td>
193
<table cellspacing=5 cellpadding=0 border=0>
201
Operator syntax for append.
206
<a class="anchor" name="a11" doxytag="IpeString::operator+=" ></a><p>
207
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
210
<table cellpadding="0" cellspacing="0" border="0">
212
<td class="md" nowrap valign="top"> void IpeString::operator+= </td>
213
<td class="md" valign="top">( </td>
214
<td class="md" nowrap valign="top">char </td>
215
<td class="mdname1" valign="top" nowrap> <em>ch</em> </td>
216
<td class="md" valign="top"> ) </td>
217
<td class="md" nowrap><code> [inline]</code></td>
224
<table cellspacing=5 cellpadding=0 border=0>
232
Operator syntax for append.
237
<a class="anchor" name="a12" doxytag="IpeString::substr" ></a><p>
238
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
241
<table cellpadding="0" cellspacing="0" border="0">
243
<td class="md" nowrap valign="top"> <a class="el" href="class_ipe_string.html">IpeString</a> IpeString::substr </td>
244
<td class="md" valign="top">( </td>
245
<td class="md" nowrap valign="top">int </td>
246
<td class="mdname" nowrap> <em>i</em>, </td>
251
<td class="md" nowrap>int </td>
252
<td class="mdname" nowrap> <em>len</em> = -1</td>
256
<td class="md">) </td>
257
<td class="md" colspan="2"> const<code> [inline]</code></td>
264
<table cellspacing=5 cellpadding=0 border=0>
277
<a class="anchor" name="a13" doxytag="IpeString::operator!=" ></a><p>
278
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
281
<table cellpadding="0" cellspacing="0" border="0">
283
<td class="md" nowrap valign="top"> bool IpeString::operator!= </td>
284
<td class="md" valign="top">( </td>
285
<td class="md" nowrap valign="top">const <a class="el" href="class_ipe_string.html">IpeString</a> & </td>
286
<td class="mdname1" valign="top" nowrap> <em>rhs</em> </td>
287
<td class="md" valign="top"> ) </td>
288
<td class="md" nowrap> const<code> [inline]</code></td>
295
<table cellspacing=5 cellpadding=0 border=0>
308
<hr>The documentation for this class was generated from the following files:<ul>
309
<li>ipebase.h<li>ipebase.cpp</ul>