aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Rewrite/HTMLRewrite.h
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-08 22:37:58 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-08 22:37:58 +0000
commitfa5be3617294f0e3c341f0ecb6b2076478b1b5ac (patch)
treed92ec56017bf04856dfe0a36e615396fffe93937 /include/clang/Rewrite/HTMLRewrite.h
parent5dd18b7d5645ddd9bb182c7cf8afc832f5f3a635 (diff)
Don't expand tabs in EscapeText, but rather expand them when writing out
the HTML file. This should reduce the amount of memory pressure on the rewriter for files that have a lot of tabs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49406 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Rewrite/HTMLRewrite.h')
-rw-r--r--include/clang/Rewrite/HTMLRewrite.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/clang/Rewrite/HTMLRewrite.h b/include/clang/Rewrite/HTMLRewrite.h
index b8f9b95913..d5bdc89070 100644
--- a/include/clang/Rewrite/HTMLRewrite.h
+++ b/include/clang/Rewrite/HTMLRewrite.h
@@ -24,8 +24,20 @@ class Rewriter;
namespace html {
- void EscapeText(Rewriter& R, unsigned FileID, bool EscapeSpaces = false);
- std::string EscapeText(const std::string& s, bool EscapeSpaces = false);
+ /// EscapeText - HTMLize a specified file so that special characters are
+ /// are translated so that they are not interpreted as HTML tags. In this
+ /// version tabs are not replaced with spaces by default, as this can
+ /// introduce a serious performance overhead as the amount of replaced
+ /// text can be very large.
+ void EscapeText(Rewriter& R, unsigned FileID,
+ bool EscapeSpaces = false, bool ReplacesTabs = false);
+
+ /// EscapeText - HTMLized the provided string so that special characters
+ /// in 's' are not interpreted as HTML tags. Unlike the version of
+ /// EscapeText that rewrites a file, this version by default replaces tabs
+ /// with spaces.
+ std::string EscapeText(const std::string& s,
+ bool EscapeSpaces = false, bool ReplaceTabs = true);
void AddLineNumbers(Rewriter& R, unsigned FileID);