summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/StringExtras.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-14 22:54:06 +0000
committerChris Lattner <sabre@nondot.org>2006-07-14 22:54:06 +0000
commit1e36126f5e8344d0df2fcf8640919cc85ff88693 (patch)
treef9aaeaa9d5a3721160128b494ea5f0c466fca9b2 /include/llvm/ADT/StringExtras.h
parent27d672136a57519095a3ef20161697749cffb57c (diff)
downloadllvm-1e36126f5e8344d0df2fcf8640919cc85ff88693.tar.gz
llvm-1e36126f5e8344d0df2fcf8640919cc85ff88693.tar.bz2
llvm-1e36126f5e8344d0df2fcf8640919cc85ff88693.tar.xz
Add two helper functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29150 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/StringExtras.h')
-rw-r--r--include/llvm/ADT/StringExtras.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringExtras.h b/include/llvm/ADT/StringExtras.h
index 066594e065..16132cd880 100644
--- a/include/llvm/ADT/StringExtras.h
+++ b/include/llvm/ADT/StringExtras.h
@@ -129,6 +129,15 @@ static inline bool StringsEqualNoCase(const std::string &LHS,
std::string getToken(std::string &Source,
const char *Delimiters = " \t\n\v\f\r");
+/// UnescapeString - Modify the argument string, turning two character sequences
+/// like '\\' 'n' into '\n'. This handles: \e \a \b \f \n \r \t \v \' \\ and
+/// \num (where num is a 1-3 byte octal value).
+void UnescapeString(std::string &Str);
+
+/// EscapeString - Modify the argument string, turning '\\' and anything that
+/// doesn't satisfy std::isprint into an escape sequence.
+void EscapeString(std::string &Str);
+
} // End llvm namespace
#endif