13 #ifndef LLVM_CLANG_REWRITE_CORE_REWRITEROPE_H
14 #define LLVM_CLANG_REWRITE_CORE_REWRITEROPE_H
16 #include "llvm/ADT/IntrusiveRefCntPtr.h"
17 #include "llvm/ADT/StringRef.h"
40 assert(
RefCount > 0 &&
"Reference count is already zero.");
42 delete [] (
char*)
this;
88 const void *CurNode =
nullptr;
108 return (*CurPiece)[CurChar];
112 return CurPiece == RHS.CurPiece && CurChar == RHS.CurChar;
119 if (CurChar+1 < CurPiece->
size())
131 return llvm::StringRef(&(*CurPiece)[0], CurPiece->
size());
154 unsigned size()
const;
177 enum { AllocChunkSize = 4080 };
178 unsigned AllocOffs = AllocChunkSize;
202 Chunks.
insert(0, MakeRopeString(Start,
End));
206 assert(
Offset <=
size() &&
"Invalid position to insert!");
207 if (Start ==
End)
return;
212 assert(
Offset+NumBytes <=
size() &&
"Invalid region to erase!");
213 if (NumBytes == 0)
return;
218 RopePiece MakeRopeString(
const char *Start,
const char *
End);
__PTRDIFF_TYPE__ ptrdiff_t
RewriteRope - A powerful string class.
RewriteRope(const RewriteRope &RHS)
void erase(unsigned Offset, unsigned NumBytes)
void assign(const char *Start, const char *End)
void insert(unsigned Offset, const char *Start, const char *End)
RewriteRope & operator=(const RewriteRope &)=delete
RopePieceBTreeIterator - This class provides read-only forward iteration over bytes that are in a Rop...
std::ptrdiff_t difference_type
bool operator!=(const RopePieceBTreeIterator &RHS) const
std::forward_iterator_tag iterator_category
RopePieceBTreeIterator operator++(int)
bool operator==(const RopePieceBTreeIterator &RHS) const
llvm::StringRef piece() const
RopePieceBTreeIterator & operator++()
RopePieceBTreeIterator()=default
RopePieceBTreeIterator iterator
RopePieceBTree & operator=(const RopePieceBTree &)=delete
void insert(unsigned Offset, const RopePiece &R)
void erase(unsigned Offset, unsigned NumBytes)
The JSON file list parser is used to communicate input to InstallAPI.
RopePiece - This class represents a view into a RopeRefCountString object.
char & operator[](unsigned Offset)
llvm::IntrusiveRefCntPtr< RopeRefCountString > StrData
RopePiece(llvm::IntrusiveRefCntPtr< RopeRefCountString > Str, unsigned Start, unsigned End)
const char & operator[](unsigned Offset) const
RopeRefCountString - This struct is allocated with 'new char[]' from the heap, and represents a refer...