clang  12.0.0git
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 ()=default
 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 = 0
unsigned EndOffs = 0

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 58 of file RewriteRope.h.

Constructor & Destructor Documentation

◆ RopePiece() [1/2]

clang::RopePiece::RopePiece ( )

◆ RopePiece() [2/2]

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

Definition at line 64 of file RewriteRope.h.

Member Function Documentation

◆ operator[]() [1/2]

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

Definition at line 68 of file RewriteRope.h.

◆ operator[]() [2/2]

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

Definition at line 71 of file RewriteRope.h.

◆ size()

unsigned clang::RopePiece::size ( ) const

Member Data Documentation

◆ EndOffs

unsigned clang::RopePiece::EndOffs = 0

Definition at line 61 of file RewriteRope.h.

◆ StartOffs

unsigned clang::RopePiece::StartOffs = 0

Definition at line 60 of file RewriteRope.h.

◆ StrData

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

Definition at line 59 of file RewriteRope.h.

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