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