# IpeString Class Reference
[Ipe Base]

Strings and buffers. More...

List of all members.

## Public Member Functions

- IpeString (const char *str)
- IpeString (const IpeString &rhs)
- IpeString (const IpeString &rhs, int index, int len)
- IpeString & operator= (const IpeString &rhs)
- char operator[] (int i) const
- bool empty () const
- const char * data () const
- int size () const
- void operator+= (const IpeString &rhs)
- void operator+= (char ch)
- IpeString substr (int i, int len=-1) const
- bool operator!= (const IpeString &rhs) const
- void erase ()
- void append (const IpeString &rhs)
- void append (char ch)
- bool operator== (const IpeString &rhs) const
- bool operator< (const IpeString &rhs) const
- IpeString operator+ (const IpeString &rhs) const
- const char * CString () const

## Detailed Description

Strings and buffers.

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.)

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!).

## Member Function Documentation

char IpeString::operator[] | ( | int | i | ) | const`[inline]`

| Return character at index i.

bool IpeString::empty | ( |  | ) | const`[inline]`

| Is the string empty?

const char* IpeString::data | ( |  | ) | const`[inline]`

| Return read-only pointer to the data.

int IpeString::size | ( |  | ) | const`[inline]`

| Return number of bytes in the string.

void IpeString::operator+= | ( | const IpeString & | rhs | ) | `[inline]`

| Operator syntax for append.

void IpeString::operator+= | ( | char | ch | ) | `[inline]`

| Operator syntax for append.

IpeString IpeString::substr | ( | int | i,
|  | int | len = -1
| ) | const`[inline]`

| Create substring.

bool IpeString::operator!= | ( | const IpeString & | rhs | ) | const`[inline]`

| Operator !=.

The documentation for this class was generated from the following files:

- ipebase.h
- ipebase.cpp