LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::RopePiece Struct Reference

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

#include "llvm/ADT/RewriteRope.h"

Public Member Functions

 RopePiece ()=default
 
 RopePiece (llvm::IntrusiveRefCntPtr< RopeRefCountString > Str, unsigned Start, unsigned End)
 
const charoperator[] (unsigned Offset) const
 
charoperator[] (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]

llvm::RopePiece::RopePiece ( )
default

◆ RopePiece() [2/2]

llvm::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 & llvm::RopePiece::operator[] ( unsigned  Offset)
inline

Definition at line 71 of file RewriteRope.h.

References llvm::Offset, StartOffs, and StrData.

◆ operator[]() [2/2]

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

Definition at line 68 of file RewriteRope.h.

References llvm::Offset, StartOffs, and StrData.

◆ size()

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

Member Data Documentation

◆ EndOffs

unsigned llvm::RopePiece::EndOffs = 0

Definition at line 61 of file RewriteRope.h.

Referenced by size().

◆ StartOffs

unsigned llvm::RopePiece::StartOffs = 0

Definition at line 60 of file RewriteRope.h.

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

◆ StrData

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

Definition at line 59 of file RewriteRope.h.

Referenced by operator[]().


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