clang 19.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"

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 ( )
default

◆ RopePiece() [2/2]

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

Definition at line 64 of file RewriteRope.h.

Member Function Documentation

◆ operator[]() [1/2]

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

Definition at line 71 of file RewriteRope.h.

References StartOffs, and StrData.

◆ operator[]() [2/2]

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

Definition at line 68 of file RewriteRope.h.

References StartOffs, and StrData.

◆ size()

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

Member Data Documentation

◆ EndOffs

unsigned clang::RopePiece::EndOffs = 0

Definition at line 61 of file RewriteRope.h.

Referenced by size().

◆ StartOffs

unsigned clang::RopePiece::StartOffs = 0

Definition at line 60 of file RewriteRope.h.

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

◆ StrData

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

Definition at line 59 of file RewriteRope.h.

Referenced by operator[]().


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