mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
23 lines
813 B
C++
23 lines
813 B
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
/* the project. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#ifndef CAMERASERVER_C_UTIL_H_
|
|
#define CAMERASERVER_C_UTIL_H_
|
|
|
|
namespace cs {
|
|
|
|
inline char* ConvertToC(llvm::StringRef in) {
|
|
char* out = static_cast<char*>(std::malloc(in.size() + 1));
|
|
std::memmove(out, in.data(), in.size());
|
|
out[in.size()] = '\0';
|
|
return out;
|
|
}
|
|
|
|
} // namespace cs
|
|
|
|
#endif // CAMERASERVER_C_UTIL_H_
|