clang  7.0.0svn
Public Member Functions | Public Attributes | List of all members
clang::RopePiece Struct Reference

RopePiece - This class represents a view into a RopeRefCountString object. More...

#include "clang/Rewrite/Core/RewriteRope.h"

Collaboration diagram for clang::RopePiece:
Collaboration graph

Public Member Functions

 RopePiece ()
 RopePiece (llvm::IntrusiveRefCntPtr< RopeRefCountString > Str, unsigned Start, unsigned End)
const char & operator[] (unsigned Offset) const
char & operator[] (unsigned Offset)
unsigned size () const

Public Attributes

llvm::IntrusiveRefCntPtr< 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 59 of file RewriteRope.h.

Constructor & Destructor Documentation

◆ RopePiece() [1/2]

clang::RopePiece::RopePiece ( )

Definition at line 64 of file RewriteRope.h.

◆ RopePiece() [2/2]

clang::RopePiece::RopePiece ( llvm::IntrusiveRefCntPtr< RopeRefCountString Str,
unsigned  Start,
unsigned  End 

Definition at line 66 of file RewriteRope.h.

Member Function Documentation

◆ operator[]() [1/2]

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

Definition at line 70 of file RewriteRope.h.

◆ operator[]() [2/2]

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

Definition at line 73 of file RewriteRope.h.

◆ size()

unsigned clang::RopePiece::size ( ) const

Member Data Documentation

◆ EndOffs

unsigned clang::RopePiece::EndOffs

Definition at line 62 of file RewriteRope.h.

◆ StartOffs

unsigned clang::RopePiece::StartOffs

Definition at line 61 of file RewriteRope.h.

◆ StrData

llvm::IntrusiveRefCntPtr<RopeRefCountString> clang::RopePiece::StrData

Definition at line 60 of file RewriteRope.h.

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