#ifndef LLVM_ADT_SMALLSTRING_H
#define LLVM_ADT_SMALLSTRING_H
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
namespace llvm {
template<unsigned InternalLen>
class SmallString : public SmallVector<char, InternalLen> {
public:
SmallString() {}
template<typename ItTy>
SmallString(ItTy S, ItTy E) : SmallVector<char, InternalLen>(S, E) {}
SmallString(const SmallString &RHS) : SmallVector<char, InternalLen>(RHS) {}
StringRef str() const { return StringRef(this->begin(), this->size()); }
operator StringRef() const { return str(); }
const char *c_str() {
this->push_back(0);
this->pop_back();
return this->data();
}
const SmallString &operator=(StringRef RHS) {
this->clear();
return *this += RHS;
}
SmallString &operator+=(StringRef RHS) {
this->append(RHS.begin(), RHS.end());
return *this;
}
SmallString &operator+=(char C) {
this->push_back(C);
return *this;
}
};
}
#endif