MCPcopy Create free account
hub / github.com/OpenNI/OpenNI / xnLogWriteBinaryData

Function xnLogWriteBinaryData

Source/OpenNI/XnLog.cpp:1061–1091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1059}
1060
1061XN_C_API void xnLogWriteBinaryData(const XnChar* csLogMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, ...)
1062{
1063 if (!xnLogIsEnabled(csLogMask, nSeverity))
1064 return;
1065
1066 // first write preceding message:
1067 va_list args;
1068 va_start(args, csFormat);
1069 xnLogWriteImplV(csLogMask, nSeverity, csFile, nLine, csFormat, args);
1070 va_end(args);
1071
1072 // now write binary data (in lines of 16 bytes)
1073 XnChar csLine[256];
1074 XnUInt32 pos = 0;
1075
1076 for (XnUInt32 i = 0; i < nDataSize; ++i)
1077 {
1078 if ((i % 16) == 0) // first byte in line
1079 {
1080 // start a new line
1081 pos = sprintf(csLine, "%6u: ", i);
1082 }
1083
1084 pos += sprintf(csLine + pos, "%02x ", pBinData[i]);
1085
1086 if ((i % 16) == 15 || (i == nDataSize-1)) // last byte in line
1087 {
1088 xnLogWriteImpl(csLogMask, nSeverity, csFile, nLine, "%s", csLine);
1089 }
1090 }
1091}
1092
1093XN_C_API XnStatus xnLogSetMaskState(const XnChar* csMask, XnBool bEnabled)
1094{

Callers

nothing calls this directly

Calls 3

xnLogIsEnabledFunction · 0.85
xnLogWriteImplVFunction · 0.85
xnLogWriteImplFunction · 0.85

Tested by

no test coverage detected