Extend StringRef's edit-distance algorithm to permit an upper bound on the allowed...
[oota-llvm.git] / include / llvm / ADT / SmallString.h
index c39d887c238e92a9b68d305787907a4f17b5eca5..05bd8a42c67f650c967e3212298deb3dda111b9a 100644 (file)
@@ -38,6 +38,15 @@ public:
   // Extra methods.
   StringRef str() const { return StringRef(this->begin(), this->size()); }
 
+  // Implicit conversion to StringRef.
+  operator StringRef() const { return str(); }
+
+  const char *c_str() {
+    this->push_back(0);
+    this->pop_back();
+    return this->data();
+  }
+
   // Extra operators.
   const SmallString &operator=(StringRef RHS) {
     this->clear();