f53df7da64
Code submissions have continually suffered from formatting inconsistencies that constantly have to be addressed. Using clang-format simplifies this by making code formatting more consistent, and allows automation of the code formatting so that maintainers can focus more on the code itself instead of code formatting.
18 lines
385 B
C++
18 lines
385 B
C++
#include "../platform.hpp"
|
|
#include <util/apple/cfstring-utils.h>
|
|
|
|
bool DeckLinkStringToStdString(decklink_string_t input, std::string &output)
|
|
{
|
|
const CFStringRef string = static_cast<CFStringRef>(input);
|
|
|
|
char *buffer = cfstr_copy_cstr(string, kCFStringEncodingASCII);
|
|
|
|
if (buffer)
|
|
output = std::string(buffer);
|
|
|
|
bfree(buffer);
|
|
CFRelease(string);
|
|
|
|
return (buffer != NULL);
|
|
}
|