MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / osvrClientGetStringParameter

Function osvrClientGetStringParameter

src/osvr/ClientKit/ParametersC.cpp:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49OSVR_ReturnCode osvrClientGetStringParameter(OSVR_ClientContext ctx,
50 const char path[], char *buf,
51 size_t len) {
52 if (ctx == nullptr) {
53 return OSVR_RETURN_FAILURE;
54 }
55 if (buf == nullptr) {
56 return OSVR_RETURN_FAILURE;
57 }
58
59 std::string val = ctx->getStringParameter(path);
60 if (val.size() + 1 > len) {
61 /// buffer too small.
62 return OSVR_RETURN_FAILURE;
63 }
64 val.copy(buf, val.size());
65 buf[val.size()] = '\0';
66 return OSVR_RETURN_SUCCESS;
67}

Callers 3

mainFunction · 0.85
getStringParameterFunction · 0.85
getStringParameterMethod · 0.85

Calls 2

getStringParameterMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected