diff options
author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-01 20:37:30 +0000 |
---|---|---|
committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-01 20:37:30 +0000 |
commit | 7dc7ac3cb20b7ef8e6febe0ac3bc430230f29893 (patch) | |
tree | 8f8f6241c8d337970dc397842482c4279e1ea9c0 /include/llvm/ADT/Twine.h | |
parent | f00140c8e16936aac3f51cc5607168f6982a987a (diff) | |
download | external_llvm-7dc7ac3cb20b7ef8e6febe0ac3bc430230f29893.zip external_llvm-7dc7ac3cb20b7ef8e6febe0ac3bc430230f29893.tar.gz external_llvm-7dc7ac3cb20b7ef8e6febe0ac3bc430230f29893.tar.bz2 |
Support/ADT/Twine: Add toNullTerminatedStringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120600 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/Twine.h')
-rw-r--r-- | include/llvm/ADT/Twine.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/llvm/ADT/Twine.h b/include/llvm/ADT/Twine.h index 82f46c9..ab8d365 100644 --- a/include/llvm/ADT/Twine.h +++ b/include/llvm/ADT/Twine.h @@ -382,6 +382,14 @@ namespace llvm { /// SmallVector and a StringRef to the SmallVector's data is returned. StringRef toStringRef(SmallVectorImpl<char> &Out) const; + /// toNullTerminatedStringRef - This returns the twine as a single null + /// terminated StringRef if it can be represented as such. Otherwise the + /// twine is written into the given SmallVector and a StringRef to the + /// SmallVector's data is returned. + /// + /// The returned StringRef's size does not include the null terminator. + StringRef toNullTerminatedStringRef(SmallVectorImpl<char> &Out) const; + /// print - Write the concatenated string represented by this twine to the /// stream \arg OS. void print(raw_ostream &OS) const; |