Home | History | Annotate | Download | only in Rewrite

Lines Matching refs:Range

105 /// ReplaceText - This method replaces a range of characters in the input
122 /// getRangeSize - Return the size in bytes of the specified range if they
124 int Rewriter::getRangeSize(const CharSourceRange &Range,
126 if (!isRewritable(Range.getBegin()) ||
127 !isRewritable(Range.getEnd())) return -1;
132 StartOff = getLocationOffsetAndFileID(Range.getBegin(), StartFileID);
133 EndOff = getLocationOffsetAndFileID(Range.getEnd(), EndFileID);
138 // If edits have been made to this buffer, the delta between the range may
150 // start of the last token if this is a token range.
151 if (Range.isTokenRange())
152 EndOff += Lexer::MeasureTokenLength(Range.getEnd(), *SourceMgr, *LangOpts);
157 int Rewriter::getRangeSize(SourceRange Range, RewriteOptions opts) const {
158 return getRangeSize(CharSourceRange::getTokenRange(Range), opts);
163 /// range. If the start or end of the range was unrewritable or if they are
168 std::string Rewriter::getRewrittenText(SourceRange Range) const {
169 if (!isRewritable(Range.getBegin()) ||
170 !isRewritable(Range.getEnd()))
175 StartOff = getLocationOffsetAndFileID(Range.getBegin(), StartFileID);
176 EndOff = getLocationOffsetAndFileID(Range.getEnd(), EndFileID);
181 // If edits have been made to this buffer, the delta between the range may
187 const char *Ptr = SourceMgr->getCharacterData(Range.getBegin());
191 EndOff += Lexer::MeasureTokenLength(Range.getEnd(), *SourceMgr, *LangOpts);
201 EndOff += Lexer::MeasureTokenLength(Range.getEnd(), *SourceMgr, *LangOpts);
300 /// ReplaceText - This method replaces a range of characters in the input
313 bool Rewriter::ReplaceText(SourceRange range, SourceRange replacementRange) {
314 if (!isRewritable(range.getBegin())) return true;
315 if (!isRewritable(range.getEnd())) return true;
317 SourceLocation start = range.getBegin();
318 unsigned origLength = getRangeSize(range);
327 bool Rewriter::IncreaseIndentation(CharSourceRange range,
329 if (range.isInvalid()) return true;
330 if (!isRewritable(range.getBegin())) return true;
331 if (!isRewritable(range.getEnd())) return true;
337 StartOff = getLocationOffsetAndFileID(range.getBegin(), StartFileID);
338 EndOff = getLocationOffsetAndFileID(range.getEnd(), EndFileID);