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

Method OpenFile

Source/OpenNI/XnDumpFileWriter.cpp:30–55  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Code ---------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

28// Code
29//---------------------------------------------------------------------------
30XnDumpWriterFileHandle 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
57void XnDumpFileWriter::Write(XnDumpWriterFileHandle hFile, const void* pBuffer, XnUInt32 nBufferSize)
58{

Callers

nothing calls this directly

Calls 2

xnLogCreateNewFileFunction · 0.85
xnOSMallocFunction · 0.50

Tested by

no test coverage detected