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

Function xnOSSaveFile

Source/OpenNI/XnOS.cpp:155–180  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155XN_C_API XnStatus xnOSSaveFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize)
156{
157 // Local function variables
158 XN_FILE_HANDLE FileHandle;
159 XnStatus nRetVal = XN_STATUS_OK;
160
161 // Validate the input/output pointers (to make sure none of them is NULL)
162 XN_VALIDATE_INPUT_PTR(cpFileName);
163 XN_VALIDATE_INPUT_PTR(pBuffer);
164
165 nRetVal = xnOSOpenFile(cpFileName, XN_OS_FILE_WRITE | XN_OS_FILE_TRUNCATE, &FileHandle);
166 XN_IS_STATUS_OK(nRetVal);
167
168 nRetVal = xnOSWriteFile(FileHandle, pBuffer, nBufferSize);
169 if (nRetVal != XN_STATUS_OK)
170 {
171 xnOSCloseFile(&FileHandle);
172 return (XN_STATUS_OS_FILE_WRITE_FAILED);
173 }
174
175 nRetVal = xnOSCloseFile(&FileHandle);
176 XN_IS_STATUS_OK(nRetVal);
177
178 // All is good...
179 return (XN_STATUS_OK);
180}
181
182XN_C_API XnStatus xnOSAppendFile(const XnChar* cpFileName, const void* pBuffer, const XnUInt32 nBufferSize)
183{

Callers 1

captureSingleFrameFunction · 0.85

Calls 3

xnOSOpenFileFunction · 0.50
xnOSWriteFileFunction · 0.50
xnOSCloseFileFunction · 0.50

Tested by

no test coverage detected