| 819 | } |
| 820 | |
| 821 | void xnLogWriteBinaryDataImplV(const XnChar* strMask, XnLogSeverity nSeverity, const XnChar* csFile, XnUInt32 nLine, XnUChar* pBinData, XnUInt32 nDataSize, const XnChar* csFormat, va_list args) |
| 822 | { |
| 823 | // first write preceding message: |
| 824 | xnLogWriteImplV(strMask, nSeverity, csFile, nLine, csFormat, args); |
| 825 | |
| 826 | // now write binary data (in lines of 16 bytes) |
| 827 | XnChar csLine[256]; |
| 828 | XnUInt32 pos = 0; |
| 829 | |
| 830 | for (XnUInt32 i = 0; i < nDataSize; ++i) |
| 831 | { |
| 832 | if ((i % 16) == 0) // first byte in line |
| 833 | { |
| 834 | // start a new line |
| 835 | pos = sprintf(csLine, "%6u: ", i); |
| 836 | } |
| 837 | |
| 838 | pos += sprintf(csLine + pos, "%02x ", pBinData[i]); |
| 839 | |
| 840 | if ((i % 16) == 15 || (i == nDataSize-1)) // last byte in line |
| 841 | { |
| 842 | xnLogWriteImpl(strMask, nSeverity, csFile, nLine, "%s", csLine); |
| 843 | } |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | XN_C_API XnStatus XN_C_DECL xnLogSetMaskMinSeverity(const XnChar* strMask, XnLogSeverity minSeverity) |
| 848 | { |
no test coverage detected