| 44 | using namespace musik::core::sdk; |
| 45 | |
| 46 | static 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: |
| 57 | http://dlib.net/dlib/server/server_http.cpp.html */ |