DriveWorks SDK Reference
5.16.65 Release
For Test and Development only

IOStream.h File Reference

Detailed Description

NVIDIA DriveWorks API: IO Streams

Description: This file defines objects that wrap file and memory streams.

Definition in file IOStream.h.

Go to the source code of this file.

Typedefs

typedef struct dwIOStreamObject * dwIOStreamHandle_t
 Stream handle. More...
 

Enumerations

enum  dwIOStreamFlags {
  DW_IOSTREAM_READ = 1 << 0 ,
  DW_IOSTREAM_WRITE = 1 << 1 ,
  DW_IOSTREAM_APPEND = 1 << 2
}
 Enumerated type for IO Stream flags (read / write / append). More...
 

Functions

DW_API_PUBLIC dwStatus dwIOStream_close (dwIOStreamHandle_t stream)
 Close a file stream that was opened with dwIOStream_openFile. More...
 
DW_API_PUBLIC dwStatus dwIOStream_openFile (dwIOStreamHandle_t *stream, const char8_t *path, uint64_t flags, dwContextHandle_t context)
 Open a file stream with the given path and read / write parameters. More...
 
DW_API_PUBLIC dwStatus dwIOStream_wrapFileDescriptor (dwIOStreamHandle_t *stream, int posixFd)
 Adopt a currently open POSIX file descriptor. More...
 

Typedef Documentation

◆ dwIOStreamHandle_t

typedef struct dwIOStreamObject* dwIOStreamHandle_t

Stream handle.

Definition at line 68 of file IOStream.h.

Enumeration Type Documentation

◆ dwIOStreamFlags

Enumerated type for IO Stream flags (read / write / append).

Enumerator
DW_IOSTREAM_READ 
DW_IOSTREAM_WRITE 
DW_IOSTREAM_APPEND 

Definition at line 59 of file IOStream.h.

Function Documentation

◆ dwIOStream_close()

DW_API_PUBLIC dwStatus dwIOStream_close ( dwIOStreamHandle_t  stream)

Close a file stream that was opened with dwIOStream_openFile.

Parameters
streamA dwIOStreamHandle_t to a currently open IO Stream handle.
Returns
DW_SUCCESS If the stream is successfully closed.
DW_INVALID_HANDLE If the stream is NULL.

◆ dwIOStream_openFile()

DW_API_PUBLIC dwStatus dwIOStream_openFile ( dwIOStreamHandle_t stream,
const char8_t path,
uint64_t  flags,
dwContextHandle_t  context 
)

Open a file stream with the given path and read / write parameters.

Parameters
[out]streamA dwIOStreamHandle_t that will be updated with the newly opened IO Stream.
[in]pathThe path to the stream to be opened.
[in]flagsThe create flags used to open the stream.
[in]contextThe DriveWorks context.
Returns
DW_SUCCESS If the file is successfully opened and the stream is updated.
DW_INVALID_ARGUMENT If the stream is NULL.
DW_INVALID_HANDLE If the context is a nullptr.
DW_FILE_NOT_FOUND If the file could not be opened.
DW_FILE_INVALID If the requested flags are invalid for the file.

◆ dwIOStream_wrapFileDescriptor()

DW_API_PUBLIC dwStatus dwIOStream_wrapFileDescriptor ( dwIOStreamHandle_t stream,
int  posixFd 
)

Adopt a currently open POSIX file descriptor.

Parameters
[out]streamA dwIOStreamHandle_t that will be updated with the newly adopted IO Stream.
[in]posixFdA POSIX file descriptor to a currently open file.
Returns
DW_SUCCESS If the POSIX file descriptor is successfully adopted.
DW_INVALID_ARGUMENT If the stream is NULL or the POSIX file descriptor is invalid.
DW_INVALID_HANDLE If the newly opened file stream is a nullptr and the stream output parameter cannot be updated.
DW_FAILURE If the stream fails to open the backing file.
Note
This function will allocate memory to hold the stream backed by the adopted file.