MCPcopy Create free account
hub / github.com/clangen/musikcube / CopyString

Function CopyString

src/plugins/server/Util.cpp:46–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44using namespace musik::core::sdk;
45
46static size_t CopyString(const std::string& src, char* dst, size_t size) {
47 size_t len = src.size() + 1; /* space for the null terminator */
48 if (dst) {
49 size_t copied = src.copy(dst, size - 1);
50 dst[copied] = '\0';
51 return copied + 1;
52 }
53 return len;
54}
55
56/* toHex, urlEncode, fromHex, urlDecode are stolen from here:
57http://dlib.net/dlib/server/server_http.cpp.html */

Callers 1

GetValueMethod · 0.70

Calls 2

copyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected