Logo Search packages:      
Sourcecode: icu version File versions  Download package

StringPiece Class Reference

#include <stringpiece.h>

Inheritance diagram for StringPiece:
Collaboration diagram for StringPiece:

List of all members.

Public Member Functions

void clear ()
const char * data () const
UBool empty () const
int32_t length () const
void remove_prefix (int32_t n)
void remove_suffix (int32_t n)
void set (const char *xdata, int32_t len)
void set (const char *str)
int32_t size () const
 StringPiece ()
 StringPiece (const char *str)
 StringPiece (const char *offset, int32_t len)
 StringPiece (const StringPiece &x, int32_t pos)
 StringPiece (const StringPiece &x, int32_t pos, int32_t len)
StringPiece substr (int32_t pos, int32_t len=npos) const

Static Public Member Functions

static void U_EXPORT2 operator delete (void *p) U_NO_THROW
static void U_EXPORT2 operator delete (void *, void *) U_NO_THROW
static void U_EXPORT2 operator delete[] (void *p) U_NO_THROW
static void *U_EXPORT2 operator new (size_t size) U_NO_THROW
static void *U_EXPORT2 operator new (size_t, void *ptr) U_NO_THROW
static void *U_EXPORT2 operator new[] (size_t size) U_NO_THROW

Static Public Attributes

static const int32_t npos = 0x7fffffff

Private Attributes

int32_t length_
const char * ptr_

Detailed Description

A string-like object that points to a sized piece of memory.

We provide non-explicit singleton constructors so users can pass in a "const char*" or a "string" wherever a "StringPiece" is expected.

Functions or methods may use const StringPiece& parameters to accept either a "const char*" or a "string" value that will be implicitly converted to a StringPiece.

Systematic usage of StringPiece is encouraged as it will reduce unnecessary conversions from "const char*" to "string" and back again.

ICU 4.2

Definition at line 52 of file stringpiece.h.

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

Generated by  Doxygen 1.6.0   Back to index