CFx SDK Documentation  2022 SP0
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_
unsigned int OdUInt32
unsigned char OdUInt8
OdSmartPtr< OdOleStorage > OdOleStoragePtr
Definition: OleStorage.h:99
OdSmartPtr< OdByteData > OdByteDataPtr
Definition: OleStorage.h:82
#define FIRSTDLL_EXPORT
Definition: RootExport.h:39
virtual void resize(SizeType bufferSize)=0
virtual SizeType readAt(SizeType start, OdUInt8 *buffer, SizeType bufferSize) const =0
virtual void flush()=0
OdUInt32 SizeType
Definition: OleStorage.h:44
virtual SizeType size() const =0
ODRX_DECLARE_MEMBERS(OdByteData)
virtual SizeType writeAt(SizeType start, const OdUInt8 *buffer, SizeType bufferSize)=0
OdOleStorageError(OdErrorContext *pErrorContext)
Definition: OleStorage.h:96
ODRX_DECLARE_MEMBERS(OdOleStorage)
virtual OdStreamBufPtr openStream(const OdString &filename, bool createIfNotFound=false, int accessMode=Oda::kFileRead)=0
virtual void init(OdByteData *pByteData, int accessMode=Oda::kFileRead)=0
virtual OdByteDataPtr rawData() const =0
static OdOleStoragePtr createServiceObject(OdByteData *pInitData)
GLuint buffer
Definition: gles2_ext.h:178