8 #ifndef CSCORE_C_UTIL_H_ 9 #define CSCORE_C_UTIL_H_ 14 #include <llvm/StringRef.h> 19 char* out =
static_cast<char*
>(std::malloc(in.
size() + 1));
20 std::memmove(out, in.
data(), in.
size());
21 out[in.
size()] =
'\0';
27 #endif // CSCORE_C_UTIL_H_ size_t size() const
size - Get the string size.
Definition: StringRef.h:149
Definition: SinkImpl.h:19
const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition: StringRef.h:139
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42