FBX C++ API Reference
fbxstream.h
Go to the documentation of this file.
1 /****************************************************************************************
2 
3  Copyright (C) 2015 Autodesk, Inc.
4  All rights reserved.
5 
6  Use of this software is subject to the terms of the Autodesk license agreement
7  provided at the time of installation or download, or which otherwise accompanies
8  this software in either electronic or hard copy form.
9 
10 ****************************************************************************************/
11 
13 #ifndef _FBXSDK_CORE_STREAM_H_
14 #define _FBXSDK_CORE_STREAM_H_
15 
16 #include <fbxsdk/fbxsdk_def.h>
17 
19 
20 #include <fbxsdk/fbxsdk_nsbegin.h>
21 
27 {
28 public:
30  enum EState
31  {
34  eEmpty
35  };
36 
38  virtual EState GetState() = 0;
39 
43  virtual bool Open(void* pStreamData) = 0;
44 
48  virtual bool Close() = 0;
49 
52  virtual bool Flush() = 0;
53 
58  virtual int Write(const void* /*pData*/, int /*pSize*/) = 0;
59 
64  virtual int Read(void* /*pData*/, int /*pSize*/) const = 0;
65 
75  virtual char* ReadString(char* pBuffer, int pMaxSize, bool pStopAtFirstWhiteSpace=false);
76 
81  virtual int GetReaderID() const = 0;
82 
87  virtual int GetWriterID() const = 0;
88 
92  virtual void Seek(const FbxInt64& pOffset, const FbxFile::ESeekPos& pSeekPos)=0;
93 
96  virtual long GetPosition() const = 0;
97 
100  virtual void SetPosition(long pPosition)=0;
101 
105  virtual int GetError() const = 0;
106 
108  virtual void ClearError() = 0;
109 
110 /*****************************************************************************************************************************
111 ** WARNING! Anything beyond these lines is for internal use, may not be documented and is subject to change without notice! **
112 *****************************************************************************************************************************/
113 #ifndef DOXYGEN_SHOULD_SKIP_THIS
114  FbxStream(){};
115  virtual ~FbxStream(){};
116 
117  int Write(const char* pData, int pSize){ return Write((void*)pData, pSize); }
118  int Write(const int* pData, int pSize){ return Write((void*)pData, pSize); }
119  int Read(char* pData, int pSize) const { return Read((void*)pData, pSize); }
120  int Read(int* pData, int pSize) const { return Read((void*)pData, pSize); }
121 #endif /* !DOXYGEN_SHOULD_SKIP_THIS *****************************************************************************************/
122 };
123 
124 #include <fbxsdk/fbxsdk_nsend.h>
125 
126 #endif /* _FBXSDK_CORE_STREAM_H_ */
FBX SDK environment definition.
Abstract class for implementing I/O operations through a stream of data.
Definition: fbxstream.h:26
EState
Current stream state.
Definition: fbxstream.h:30
ESeekPos
Definition: fbxfile.h:31
The stream is open.
Definition: fbxstream.h:33
The stream is closed.
Definition: fbxstream.h:32
signed long long FbxInt64
Definition: fbxtypes.h:81
#define FBXSDK_DLL
Definition: fbxarch.h:173