BRE12
IOStream.hpp
1 /*
2 ---------------------------------------------------------------------------
3 Open Asset Import Library (assimp)
4 ---------------------------------------------------------------------------
5 
6 Copyright (c) 2006-2012, assimp team
7 
8 All rights reserved.
9 
10 Redistribution and use of this software in source and binary forms,
11 with or without modification, are permitted provided that the following
12 conditions are met:
13 
14 * Redistributions of source code must retain the above
15  copyright notice, this list of conditions and the
16  following disclaimer.
17 
18 * Redistributions in binary form must reproduce the above
19  copyright notice, this list of conditions and the
20  following disclaimer in the documentation and/or other
21  materials provided with the distribution.
22 
23 * Neither the name of the assimp team, nor the names of its
24  contributors may be used to endorse or promote products
25  derived from this software without specific prior
26  written permission of the assimp team.
27 
28 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 ---------------------------------------------------------------------------
40 */
45 #ifndef AI_IOSTREAM_H_INC
46 #define AI_IOSTREAM_H_INC
47 
48 #include "types.h"
49 
50 #ifndef __cplusplus
51 # error This header requires C++ to be used. aiFileIO.h is the \
52  corresponding C interface.
53 #endif
54 
55 namespace Assimp {
56 
57 // ----------------------------------------------------------------------------------
64 class ASSIMP_API IOStream
65 #ifndef SWIG
66  : public Intern::AllocateFromAssimpHeap
67 #endif
68 {
69 protected:
71  IOStream(void);
72 
73 public:
74  // -------------------------------------------------------------------
78  virtual ~IOStream();
79 
80  // -------------------------------------------------------------------
85  virtual size_t Read(void* pvBuffer,
86  size_t pSize,
87  size_t pCount) = 0;
88 
89  // -------------------------------------------------------------------
94  virtual size_t Write(const void* pvBuffer,
95  size_t pSize,
96  size_t pCount) = 0;
97 
98  // -------------------------------------------------------------------
103  virtual aiReturn Seek(size_t pOffset,
104  aiOrigin pOrigin) = 0;
105 
106  // -------------------------------------------------------------------
110  virtual size_t Tell() const = 0;
111 
112  // -------------------------------------------------------------------
115  virtual size_t FileSize() const = 0;
116 
117  // -------------------------------------------------------------------
121  virtual void Flush() = 0;
122 };
123 
124 // ----------------------------------------------------------------------------------
126 {
127  // empty
128 }
129 
130 // ----------------------------------------------------------------------------------
132 {
133  // empty
134 }
135 // ----------------------------------------------------------------------------------
136 }
137 
138 #endif
Basic data types and primitives, such as vectors or colors.
Assimp's CPP-API and all internal APIs.
Definition: DefaultLogger.hpp:51
CPP-API: Class to handle file I/O for C++.
Definition: IOStream.hpp:64
IOStream(void)
Constructor protected, use IOSystem::Open() to create an instance.
Definition: IOStream.hpp:125
virtual ~IOStream()
Destructor.
Definition: IOStream.hpp:131