CFx SDK Documentation
2026 SP0
Loading...
Searching...
No Matches
SDK
CFx
dd_inc
OdStreamBuf.h
Go to the documentation of this file.
1
2
// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3
// All rights reserved.
4
//
5
// This software and its documentation and related materials are owned by
6
// the Alliance. The software may only be incorporated into application
7
// programs owned by members of the Alliance, subject to a signed
8
// Membership Agreement and Supplemental Software License Agreement with the
9
// Alliance. The structure and organization of this software are the valuable
10
// trade secrets of the Alliance and its suppliers. The software is also
11
// protected by copyright law and international treaty provisions. Application
12
// programs incorporating this software must include the following statement
13
// with their copyright notices:
14
//
15
// This application incorporates Open Design Alliance software pursuant to a license
16
// agreement with Open Design Alliance.
17
// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18
// All rights reserved.
19
//
20
// By use of this software, its documentation or related materials, you
21
// acknowledge and accept the above terms.
23
24
25
26
27
#ifndef ODSTREAMBUF_DEFINED
28
#define ODSTREAMBUF_DEFINED
29
30
#if !defined( FX_PREVIEW )
31
#include "
RxObject.h
"
32
33
#include "
TD_PackPush.h
"
34
35
class
OdString
;
36
#else
37
#include <stdio.h>
38
#include <string>
39
#include "
OdPlatformSettings.h
"
40
#endif
41
42
namespace
Oda
43
{
45
46
47
enum
FileAccessMode
// Access
48
{
49
kFileRead
= (long)
50
0x80000000,
// Read access. Use kFileRead | kFileWrite for read/write access.
51
kFileWrite
= 0x40000000,
// Write access. Use kFileRead | kFileWrite for read/write access.
52
kFileTmp
= 0x20000000,
// hint to use FILE_ATTRIBUTE_TEMPORARY for 'FlagsAndAttributes'
53
kFileDelete
= 0x10000000,
// hint to use FILE_FLAG_DELETE_ON_CLOSE for 'FlagsAndAttributes'
54
kNoFlushWhenClosed
= 0x08000000,
//do NOT call FlushFileBuffers when closing file (tremendously accelerates writing small files)
55
kFileReadWrite
=
kFileRead
|
kFileWrite
// Read/Write access.
56
};
57
58
#if !defined( FX_PREVIEW )
59
FileAccessMode
FIRSTDLL_EXPORT
operator |
(
const
FileAccessMode
& a,
const
FileAccessMode
& b);
60
#else
61
FileAccessMode
operator |
(
const
FileAccessMode
& a,
const
FileAccessMode
& b);
62
#endif
63
64
enum
FileShareMode
65
{
66
kShareDenyReadWrite
= 0x10,
// deny read/write mode
67
kShareDenyWrite
= 0x20,
// deny write mode
68
kShareDenyRead
= 0x30,
// deny read mode
69
kShareDenyNo
= 0x40
// deny none mode
70
};
71
72
73
enum
FileCreationDisposition
74
{
75
kCreateNew
= 1,
// Creates a new file; fails if the specified file already exists.
76
kCreateAlways
= 2,
// Creates a new file; overwrites any existing file.
77
kOpenExisting
= 3,
// Opens the file; fails if the file does not exist.
78
kOpenAlways
= 4,
// Opens the file; creates the file if it does not exist.
79
kTruncateExisting
= 5
// Truncates the file; fails if the file does not exist. The file must be open at least kFileWrite.
80
};
81
}
82
87
namespace
OdDb
88
{
89
enum
FilerSeekType
90
{
91
kSeekFromStart
= SEEK_SET,
// Start of file.
92
kSeekFromCurrent
= SEEK_CUR,
// Current position of file pointer.
93
kSeekFromEnd
= SEEK_END
// End of file.
94
};
95
}
96
103
#if !defined( FX_PREVIEW )
104
class
FIRSTDLL_EXPORT
OdStreamBuf
:
public
OdRxObject
105
#else
106
class
OdStreamBuf
107
#endif
108
{
109
protected
:
110
OdStreamBuf
();
111
public
:
112
#if !defined( FX_PREVIEW )
113
ODRX_DECLARE_MEMBERS
(
OdStreamBuf
);
114
#endif
115
119
#if !defined( FX_PREVIEW )
120
virtual
OdString
fileName
();
121
#else
122
virtual
std::wstring
fileName
();
123
#endif
124
129
virtual
bool
isEof
();
134
virtual
OdUInt64
tell
();
139
virtual
OdUInt64
length
();
140
145
virtual
void
truncate
();
150
virtual
void
rewind
();
168
virtual
OdUInt64
seek
(
OdInt64
offset
,
OdDb::FilerSeekType
seekType);
169
174
virtual
OdUInt8
getByte
();
181
virtual
void
getBytes
(
void
*
buffer
,
OdUInt32
numBytes);
182
188
virtual
void
putByte
(
OdUInt8
value
);
195
virtual
void
putBytes
(
const
void
*
buffer
,
OdUInt32
numBytes);
196
205
virtual
void
copyDataTo
(
OdStreamBuf
* pDestination,
OdUInt64
sourceStart = 0,
OdUInt64
sourceEnd = 0);
220
virtual
OdUInt32
getShareMode
();
221
236
virtual
Oda::FileShareMode
getShareMode
()
const
;
237
};
238
241
#if !defined( FX_PREVIEW )
242
typedef
OdSmartPtr<OdStreamBuf>
OdStreamBufPtr
;
243
244
#include "
TD_PackPop.h
"
245
#endif
246
247
#endif
//ODSTREAMBUF_DEFINED
248
OdStreamBufPtr
OdSmartPtr< OdStreamBuf > OdStreamBufPtr
Definition
DbPageController.h:36
OdPlatformSettings.h
OdUInt32
unsigned int OdUInt32
Definition
OdPlatformSettings.h:768
OdUInt8
unsigned char OdUInt8
Definition
OdPlatformSettings.h:744
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition
RootExport.h:39
RxObject.h
TD_PackPop.h
TD_PackPush.h
OdInt64
Definition
Int64.h:43
OdSmartPtr
Definition
SmartPtr.h:58
OdStreamBuf::getByte
virtual OdUInt8 getByte()
OdStreamBuf::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdStreamBuf)
OdStreamBuf::rewind
virtual void rewind()
OdStreamBuf::tell
virtual OdUInt64 tell()
OdStreamBuf::getShareMode
virtual Oda::FileShareMode getShareMode() const
OdStreamBuf::fileName
virtual OdString fileName()
OdStreamBuf::length
virtual OdUInt64 length()
OdStreamBuf::getBytes
virtual void getBytes(void *buffer, OdUInt32 numBytes)
OdStreamBuf::truncate
virtual void truncate()
OdStreamBuf::isEof
virtual bool isEof()
OdStreamBuf::copyDataTo
virtual void copyDataTo(OdStreamBuf *pDestination, OdUInt64 sourceStart=0, OdUInt64 sourceEnd=0)
OdStreamBuf::getShareMode
virtual OdUInt32 getShareMode()
OdStreamBuf::seek
virtual OdUInt64 seek(OdInt64 offset, OdDb::FilerSeekType seekType)
OdStreamBuf::OdStreamBuf
OdStreamBuf()
OdStreamBuf::putByte
virtual void putByte(OdUInt8 value)
OdStreamBuf::putBytes
virtual void putBytes(const void *buffer, OdUInt32 numBytes)
OdString
Definition
OdString.h:97
OdUInt64
Definition
Int64.h:137
buffer
GLuint buffer
Definition
gles2_ext.h:178
offset
GLintptr offset
Definition
gles2_ext.h:183
value
GLsizei const GLfloat * value
Definition
gles2_ext.h:302
OdDb
Definition
Db2dPolyline.h:51
OdDb::FilerSeekType
FilerSeekType
Definition
OdStreamBuf.h:90
OdDb::kSeekFromCurrent
@ kSeekFromCurrent
Definition
OdStreamBuf.h:92
OdDb::kSeekFromStart
@ kSeekFromStart
Definition
OdStreamBuf.h:91
OdDb::kSeekFromEnd
@ kSeekFromEnd
Definition
OdStreamBuf.h:93
Oda
Definition
TxDefs.h:49
Oda::FileShareMode
FileShareMode
Definition
OdStreamBuf.h:65
Oda::kShareDenyRead
@ kShareDenyRead
Definition
OdStreamBuf.h:68
Oda::kShareDenyWrite
@ kShareDenyWrite
Definition
OdStreamBuf.h:67
Oda::kShareDenyNo
@ kShareDenyNo
Definition
OdStreamBuf.h:69
Oda::kShareDenyReadWrite
@ kShareDenyReadWrite
Definition
OdStreamBuf.h:66
Oda::operator|
FileAccessMode FIRSTDLL_EXPORT operator|(const FileAccessMode &a, const FileAccessMode &b)
Oda::FileCreationDisposition
FileCreationDisposition
Definition
OdStreamBuf.h:74
Oda::kCreateNew
@ kCreateNew
Definition
OdStreamBuf.h:75
Oda::kOpenAlways
@ kOpenAlways
Definition
OdStreamBuf.h:78
Oda::kCreateAlways
@ kCreateAlways
Definition
OdStreamBuf.h:76
Oda::kTruncateExisting
@ kTruncateExisting
Definition
OdStreamBuf.h:79
Oda::kOpenExisting
@ kOpenExisting
Definition
OdStreamBuf.h:77
Oda::FileAccessMode
FileAccessMode
Definition
OdStreamBuf.h:48
Oda::kFileDelete
@ kFileDelete
Definition
OdStreamBuf.h:53
Oda::kFileReadWrite
@ kFileReadWrite
Definition
OdStreamBuf.h:55
Oda::kFileWrite
@ kFileWrite
Definition
OdStreamBuf.h:51
Oda::kNoFlushWhenClosed
@ kNoFlushWhenClosed
Definition
OdStreamBuf.h:54
Oda::kFileRead
@ kFileRead
Definition
OdStreamBuf.h:49
Oda::kFileTmp
@ kFileTmp
Definition
OdStreamBuf.h:52
Generated on Tue Apr 15 2025 11:30:04