clang API Documentation

Public Member Functions | Public Attributes
clang::RopePiece Struct Reference

#include <RewriteRope.h>

Collaboration diagram for clang::RopePiece:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RopePiece ()
 RopePiece (RopeRefCountString *Str, unsigned Start, unsigned End)
 RopePiece (const RopePiece &RP)
 ~RopePiece ()
void operator= (const RopePiece &RHS)
const char & operator[] (unsigned Offset) const
char & operator[] (unsigned Offset)
unsigned size () const

Public Attributes

RopeRefCountStringStrData
unsigned StartOffs
unsigned EndOffs

Detailed Description

RopePiece - This class represents a view into a RopeRefCountString object. This allows references to string data to be efficiently chopped up and moved around without having to push around the string data itself.

For example, we could have a 1M RopePiece and want to insert something into the middle of it. To do this, we split it into two RopePiece objects that both refer to the same underlying RopeRefCountString (just with different offsets) which is a nice constant time operation.

Definition at line 57 of file RewriteRope.h.


Constructor & Destructor Documentation

clang::RopePiece::RopePiece ( ) [inline]

Definition at line 62 of file RewriteRope.h.

clang::RopePiece::RopePiece ( RopeRefCountString Str,
unsigned  Start,
unsigned  End 
) [inline]

Definition at line 64 of file RewriteRope.h.

References clang::RopeRefCountString::addRef(), and StrData.

clang::RopePiece::RopePiece ( const RopePiece RP) [inline]

Definition at line 68 of file RewriteRope.h.

References clang::RopeRefCountString::addRef(), and StrData.

clang::RopePiece::~RopePiece ( ) [inline]

Definition at line 73 of file RewriteRope.h.

References clang::RopeRefCountString::dropRef(), and StrData.


Member Function Documentation

void clang::RopePiece::operator= ( const RopePiece RHS) [inline]
const char& clang::RopePiece::operator[] ( unsigned  Offset) const [inline]

Definition at line 87 of file RewriteRope.h.

References clang::RopeRefCountString::Data, StartOffs, and StrData.

char& clang::RopePiece::operator[] ( unsigned  Offset) [inline]

Definition at line 90 of file RewriteRope.h.

References clang::RopeRefCountString::Data, StartOffs, and StrData.

unsigned clang::RopePiece::size ( ) const [inline]

Definition at line 94 of file RewriteRope.h.

References EndOffs, and StartOffs.

Referenced by clang::RopePieceBTreeIterator::operator++().


Member Data Documentation

Definition at line 60 of file RewriteRope.h.

Referenced by operator=(), and size().

Definition at line 59 of file RewriteRope.h.

Referenced by operator=(), operator[](), and size().

Definition at line 58 of file RewriteRope.h.

Referenced by operator=(), operator[](), RopePiece(), and ~RopePiece().


The documentation for this struct was generated from the following file: