The Pedigree Project 0.1
Classes | Public Member Functions | Private Attributes | Friends | List of all members
Cord Class Reference
+ Collaboration diagram for Cord:

Classes

class  CordIterator
 
struct  CordSegment
 
class  CordSegmentIterator
 

Public Member Functions

 Cord (const Cord &other)
 
Cord & operator= (const Cord &s)
 
bool operator== (const char *s) const
 
bool operator== (const Cord &s) const
 
bool operator== (const String &s) const
 
void reserve (size_t segments)
 
void assign (const Cord &other)
 
void clear ()
 
size_t length () const
 
String toString () const
 
char operator[] (size_t index) const
 
void append (const char *s, size_t len=0)
 
void prepend (const char *s, size_t len=0)
 
void append (const String &str)
 
void prepend (const String &str)
 
CordIterator begin () const
 
CordIterator end () const
 
CordSegmentIterator segbegin () const
 
CordSegmentIterator segend () const
 

Private Attributes

Vector< CordSegment > m_Segments
 
size_t m_Length = 0
 

Friends

class CordIterator
 
class String
 

Detailed Description

Definition at line 33 of file Cord.h.

Constructor & Destructor Documentation

◆ Cord()

Cord::Cord ( const Cord &  other)

Definition at line 28 of file Cord.cc.

◆ ~Cord()

Cord::~Cord ( )
virtual

Definition at line 32 of file Cord.cc.

Member Function Documentation

◆ append() [1/2]

void Cord::append ( const char *  s,
size_t  len = 0 
)

Definition at line 97 of file Cord.cc.

◆ append() [2/2]

void Cord::append ( const String &  str)
Note
The String& versions of append/prepend are somewhat dangerous. Use these with caution, as if the String is modified or freed, the Cord will point at invalid memory.

Definition at line 121 of file Cord.cc.

◆ assign()

void Cord::assign ( const Cord &  other)

Definition at line 45 of file Cord.cc.

◆ begin()

Cord::CordIterator Cord::begin ( ) const

Definition at line 129 of file Cord.cc.

◆ clear()

void Cord::clear ( )

Definition at line 59 of file Cord.cc.

◆ end()

Cord::CordIterator Cord::end ( ) const

Definition at line 133 of file Cord.cc.

◆ length()

size_t Cord::length ( ) const

Definition at line 64 of file Cord.cc.

◆ operator=()

Cord & Cord::operator= ( const Cord &  s)

Definition at line 36 of file Cord.cc.

◆ operator[]()

char Cord::operator[] ( size_t  index) const
Todo:
should this be more crashy?

Definition at line 83 of file Cord.cc.

◆ prepend() [1/2]

void Cord::prepend ( const char *  s,
size_t  len = 0 
)

Definition at line 109 of file Cord.cc.

◆ prepend() [2/2]

void Cord::prepend ( const String &  str)

Definition at line 125 of file Cord.cc.

◆ reserve()

void Cord::reserve ( size_t  segments)

Pre-reserve the given number of segments. Useful if the segment count is known in advance to avoid vector resizes.

Definition at line 41 of file Cord.cc.

◆ segbegin()

Cord::CordSegmentIterator Cord::segbegin ( ) const

Definition at line 137 of file Cord.cc.

◆ segend()

Cord::CordSegmentIterator Cord::segend ( ) const

Definition at line 141 of file Cord.cc.

◆ toString()

String Cord::toString ( ) const

Definition at line 68 of file Cord.cc.

Friends And Related Symbol Documentation

◆ CordIterator

friend class CordIterator
friend

Definition at line 34 of file Cord.h.

◆ String

friend class String
friend

Definition at line 35 of file Cord.h.

Member Data Documentation

◆ m_Length

size_t Cord::m_Length = 0
private

Definition at line 142 of file Cord.h.

◆ m_Segments

Vector<CordSegment> Cord::m_Segments
private

Definition at line 141 of file Cord.h.


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