NVIDIA DriveOS Linux NSR SDK API Reference

7.0.3.0 Release
IOStream.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2016-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
28 #ifndef DW_CORE_IOSTREAM_H_
29 #define DW_CORE_IOSTREAM_H_
30 
31 #include <dw/core/base/Exports.h>
32 #include <dw/core/base/Types.h>
33 #include <dw/core/base/Status.h>
34 #include <dw/core/context/Context.h>
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
43 typedef enum dwIOStreamFlags {
44  DW_IOSTREAM_READ = 1 << 0,
45  DW_IOSTREAM_WRITE = 1 << 1,
46  DW_IOSTREAM_APPEND = 1 << 2,
49 
53 typedef struct dwIOStreamObject* dwIOStreamHandle_t;
54 
74 dwStatus dwIOStream_openFile(dwIOStreamHandle_t* stream, const char8_t* path, uint64_t flags, dwContextHandle_t context);
75 
95 
96 // Reading, seeking and other interfaces intentionally omitted, as the goal of this API is not
97 // to provide a replacement for stdio to users, but to serve as a way to communicate how data is
98 // to be read to other DW APIs.
99 
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif
dwIOStream_close
DW_API_PUBLIC dwStatus dwIOStream_close(dwIOStreamHandle_t stream)
Close a file stream that was opened with dwIOStream_openFile.
dwIOStream_wrapFileDescriptor
DW_API_PUBLIC dwStatus dwIOStream_wrapFileDescriptor(dwIOStreamHandle_t *stream, int posixFd)
Adopt a currently open POSIX file descriptor.
DW_IOSTREAM_APPEND
@ DW_IOSTREAM_APPEND
Stream flag for append access.
Definition: IOStream.h:46
dwIOStreamHandle_t
struct dwIOStreamObject * dwIOStreamHandle_t
Stream handle.
Definition: IOStream.h:53
dwIOStreamFlags
dwIOStreamFlags
Enumerated type for IO Stream flags.
Definition: IOStream.h:43
char8_t
char char8_t
Definition: BasicTypes.h:47
DW_IOSTREAM_READ
@ DW_IOSTREAM_READ
Stream flag for read access.
Definition: IOStream.h:44
dwContextHandle_t
struct dwContextObject * dwContextHandle_t
Context handle.
Definition: Context.h:74
dwStatus
dwStatus
Status definition.
Definition: ErrorDefs.h:27
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.
DW_API_PUBLIC
#define DW_API_PUBLIC
Definition: Exports.h:38
DW_IOSTREAM_FORCE_BUFFERED
@ DW_IOSTREAM_FORCE_BUFFERED
Stream flag to forcing buffered underlying filestream.
Definition: IOStream.h:47
DW_IOSTREAM_WRITE
@ DW_IOSTREAM_WRITE
Stream flag for write access.
Definition: IOStream.h:45