add a simple c_str() method to SmallString.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82337 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2009-09-19 23:57:31 +00:00
parent 68a77ab5d2
commit 3670a01d0b

View File

@ -38,6 +38,12 @@ public:
// Extra methods.
StringRef str() const { return StringRef(this->begin(), this->size()); }
const char *c_str() {
this->push_back(0);
this->pop_back();
return this->data();
}
// Extra operators.
const SmallString &operator=(StringRef RHS) {
this->clear();