CFx SDK Documentation  2020SP3
OleStorage.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 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 #ifndef _ODSTORAGE_INCLUDED_
26 #define _ODSTORAGE_INCLUDED_
27 
28 #include "RxObject.h"
29 #include "OdStreamBuf.h"
30 #include "DbSystemServices.h"
31 #include "OdErrorContext.h"
32 
33 #include "TD_PackPush.h"
34 
42 {
43 public:
44  typedef OdUInt32 SizeType;
45 
54  virtual SizeType readAt(SizeType start, OdUInt8 *buffer, SizeType bufferSize) const = 0;
55 
61  virtual SizeType writeAt(SizeType start, const OdUInt8 *buffer, SizeType bufferSize) = 0;
62 
66  virtual SizeType size() const = 0;
71  virtual void resize(SizeType bufferSize) = 0;
72 
76  virtual void flush() = 0;
77 };
78 
83 
84 
91 class OdOleStorageError : public OdError
92 {
93 public:
96  OdOleStorageError(OdErrorContext* pErrorContext) : OdError(pErrorContext) { }
97 };
98 
99 class OdOleStorage;
104 
112 {
113 public:
115 
130  virtual void init(OdByteData* pByteData, int accessMode = Oda::kFileRead) = 0;
131 
135  virtual OdByteDataPtr rawData() const = 0;
136 
159  virtual OdStreamBufPtr openStream(const OdString &filename,
160  bool createIfNotFound = false,
161  int accessMode = Oda::kFileRead) = 0;
162 
168 };
169 
170 #define ODRX_OLESTORAGE_SERVICE_NAME OdOleStorage::desc()->name()
171 
172 #include "TD_PackPop.h"
173 
174 #endif // _ODSTORAGE_INCLUDED_
FIRSTDLL_EXPORT
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
OdString
Definition: OdString.h:95
OdUInt8
unsigned char OdUInt8
Definition: OdPlatformSettings.h:759
OdErrorContext.h
OdByteData::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdByteData)
buffer
GLuint buffer
Definition: gles2_ext.h:178
OdOleStorage
Definition: OleStorage.h:112
OdRxObject
Definition: RxObject.h:564
OdByteDataPtr
OdSmartPtr< OdByteData > OdByteDataPtr
Definition: OleStorage.h:82
OdOleStoragePtr
OdSmartPtr< OdOleStorage > OdOleStoragePtr
Definition: OleStorage.h:99
OdOleStorageError
Definition: OleStorage.h:92
TD_PackPop.h
Oda::kFileRead
@ kFileRead
Definition: RxSystemServices.h:56
OdByteData::SizeType
OdUInt32 SizeType
Definition: OleStorage.h:44
RxObject.h
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdByteData::resize
virtual void resize(SizeType bufferSize)=0
OdErrorContext
Definition: OdErrorContext.h:44
OdStreamBuf.h
OdOleStorage::createServiceObject
static OdOleStoragePtr createServiceObject(OdByteData *pInitData)
OdSmartPtr
Definition: SmartPtr.h:58
OdByteData::readAt
virtual SizeType readAt(SizeType start, OdUInt8 *buffer, SizeType bufferSize) const =0
OdByteData::size
virtual SizeType size() const =0
OdOleStorageError::OdOleStorageError
OdOleStorageError(OdErrorContext *pErrorContext)
Definition: OleStorage.h:96
TD_PackPush.h
OdByteData
Definition: OleStorage.h:42
OdError
Definition: OdError.h:43
OdByteData::flush
virtual void flush()=0
OdOleStorage::init
virtual void init(OdByteData *pByteData, int accessMode=Oda::kFileRead)=0
OdOleStorage::rawData
virtual OdByteDataPtr rawData() const =0
OdOleStorage::openStream
virtual OdStreamBufPtr openStream(const OdString &filename, bool createIfNotFound=false, int accessMode=Oda::kFileRead)=0
DbSystemServices.h
OdOleStorage::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(OdOleStorage)
OdByteData::writeAt
virtual SizeType writeAt(SizeType start, const OdUInt8 *buffer, SizeType bufferSize)=0