--------------------------------------------------------------------------- Code ---------------------------------------------------------------------------
| 28 | // Code |
| 29 | //--------------------------------------------------------------------------- |
| 30 | XnDumpWriterFileHandle XnDumpFileWriter::OpenFile(const XnChar* /*strDumpName*/, XnBool bSessionDump, const XnChar* strFileName) |
| 31 | { |
| 32 | XnStatus nRetVal = XN_STATUS_OK; |
| 33 | |
| 34 | XnDumpWriterFileHandle result = { NULL }; |
| 35 | |
| 36 | XN_FILE_HANDLE* phFile = (XN_FILE_HANDLE*)xnOSMalloc(sizeof(XN_FILE_HANDLE)); |
| 37 | if (phFile == NULL) |
| 38 | { |
| 39 | return result; |
| 40 | } |
| 41 | |
| 42 | XnChar strFullPath[XN_FILE_MAX_PATH]; |
| 43 | nRetVal = xnLogCreateNewFile(strFileName, bSessionDump, strFullPath, XN_FILE_MAX_PATH, phFile); |
| 44 | if (nRetVal != XN_STATUS_OK) |
| 45 | { |
| 46 | // we don't have much to do if files can't be open. Dump will not be written |
| 47 | xnLogWarning(XN_MASK_LOG, "Couldn't create dump file %s! Dump will not be written", strFileName); |
| 48 | } |
| 49 | else |
| 50 | { |
| 51 | result.pInternal = phFile; |
| 52 | } |
| 53 | |
| 54 | return result; |
| 55 | } |
| 56 | |
| 57 | void XnDumpFileWriter::Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize) |
| 58 | { |
nothing calls this directly
no test coverage detected