- Main Page
- Classes
- Files
- Directories

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions

# FbxStream Class Reference

This reference page is linked to from the following overview topics: FBX SDK 2014.

Search for all occurrences

## Detailed Description

Abstract class for implementing I/O operations through a stream of data.

For instance, it can be used to read data from a memory source, thus making it possible to import files from memory. However, for the time being, the FbxStream class is only supported with FBX files.

Definition at line 26 of file fbxstream.h.

`#include <fbxstream.h>`

List of all members.

## Public Types
enum | EState { eClosed, eOpen, eEmpty }
## Public Member Functions
virtual EState | GetState ()=0
| Query the current state of the stream.
virtual bool | Open (void *pStreamData)=0
| Open the stream.
virtual bool | Close ()=0
| Close the stream.
virtual bool | Flush ()=0
| Empties the internal data of the stream.
virtual int | Write (const void *, int)=0
| Writes a memory block.
virtual int | Read (void *, int) const =0
| Read bytes from the stream and store them in the memory block.
virtual char * | ReadString (char *pBuffer, int pMaxSize, bool pStopAtFirstWhiteSpace=false)
| Read a string from the stream.
virtual int | GetReaderID () const =0
| If not specified by KFbxImporter::Initialize(), the importer will ask the stream to select an appropriate reader ID to associate with the stream.
virtual int | GetWriterID () const =0
| If not specified by KFbxExporter::Initialize(), the exporter will ask the stream to select an appropriate writer ID to associate with the stream.
virtual void | Seek (const FbxInt64 &pOffset, const FbxFile::ESeekPos &pSeekPos)=0
| Adjust the current stream position.
virtual long | GetPosition () const =0
| Get the current stream position.
virtual void | SetPosition (long pPosition)=0
| Set the current stream position.
virtual int | GetError () const =0
| Return 0 if no errors occurred.
virtual void | ClearError ()=0
| Clear current error condition by setting the current error value to 0.
| FbxStream ()
virtual | ~FbxStream ()
int | Write (const char *pData, int pSize)
int | Write (const int *pData, int pSize)
int | Read (char *pData, int pSize) const
int | Read (int *pData, int pSize) const

## Member Enumeration Documentation

enum EState

Search for all occurrences

Enumerator:

  eClosed | The stream is closed. Search for all occurrences
  eOpen | The stream is open. Search for all occurrences
  eEmpty | The stream is empty. Search for all occurrences

Definition at line 30 of file fbxstream.h.

        {
            eClosed,
            eOpen,
            eEmpty
        };

## Constructor & Destructor Documentation

FbxStream | ( |  | ) | `[inline]`

Definition at line 114 of file fbxstream.h.

    {};

virtual ~FbxStream | ( |  | ) | `[inline, virtual]`

Definition at line 115 of file fbxstream.h.

    {};

## Member Function Documentation

virtual EState GetState | ( |  | ) | `[pure virtual]`

Search for all occurrences

Query the current state of the stream.

virtual bool Open | ( | void * | pStreamData | ) | `[pure virtual]`

Search for all occurrences

Open the stream.

Returns:
  True if successful.

Remarks:
  Each time the stream is open or closed, the stream position must be reset to zero.

virtual bool Close | ( |  | ) | `[pure virtual]`

Search for all occurrences

Close the stream.

Returns:
  True if successful.

Remarks:
  Each time the stream is open or closed, the stream position must be reset to zero.

virtual bool Flush | ( |  | ) | `[pure virtual]`

Search for all occurrences

Empties the internal data of the stream.

Returns:
  True if successful.

virtual int Write | ( | const void * | ,
|  | int |
| ) |  | `[pure virtual]`

Search for all occurrences

Writes a memory block.

Parameters:

  pData | Pointer to the memory block to write.
  pSize | Size (in bytes) of the memory block to write.

Returns:
  The number of bytes written in the stream.

virtual int Read | ( | void * | ,
|  | int |
| ) |  | const`[pure virtual]`

Search for all occurrences

Read bytes from the stream and store them in the memory block.

Parameters:

  pData | Pointer to the memory block where the read bytes are stored.
  pSize | Number of bytes read from the stream.

Returns:
  The actual number of bytes successfully read from the stream.

virtual char* ReadString | ( | char * | pBuffer,
|  | int | pMaxSize,
|  | bool | pStopAtFirstWhiteSpace = `false`
| ) |  | `[virtual]`

Search for all occurrences

Read a string from the stream.

The default implementation is written in terms of Read() but does not cope with DOS line endings. Subclasses may need to override this if DOS line endings are to be supported.

Parameters:

  pData | Pointer to the memory block where the read bytes are stored.
  pMaxSize | Maximum number of bytes to be read from the stream.
  pStopAtFirstWhiteSpace | Stop reading when any whitespace is encountered. Otherwise read to end of line (like fgets()).

Returns:
  pBuffer, if successful, else NULL.

Remarks:
  The default implementation terminates the pBuffer with a null character and assumes there is enough room for it. For example, a call with pMaxSize = 1 will fill pBuffer with the null character only.

virtual int GetReaderID | ( |  | ) | const`[pure virtual]`

Search for all occurrences

If not specified by KFbxImporter::Initialize(), the importer will ask the stream to select an appropriate reader ID to associate with the stream.

FbxIOPluginRegistry can be used to locate id by extension or description. Return -1 to allow FBX to select an appropriate default.

virtual int GetWriterID | ( |  | ) | const`[pure virtual]`

Search for all occurrences

If not specified by KFbxExporter::Initialize(), the exporter will ask the stream to select an appropriate writer ID to associate with the stream.

KFbxIOPluginRegistry can be used to locate id by extension or description. Return -1 to allow FBX to select an appropriate default.

virtual void Seek | ( | const FbxInt64 & | pOffset,
|  | const FbxFile::ESeekPos & | pSeekPos
| ) |  | `[pure virtual]`

Search for all occurrences

Adjust the current stream position.

Parameters:

  pSeekPos | Pre-defined position where offset is added (FbxFile::eBegin, FbxFile::eCurrent:, FbxFile::eEnd)
  pOffset | Number of bytes to offset from pSeekPos.

virtual long GetPosition | ( |  | ) | const`[pure virtual]`

Search for all occurrences

Get the current stream position.

Returns:
  Current number of bytes from the beginning of the stream.

virtual void SetPosition | ( | long | pPosition | ) | `[pure virtual]`

Search for all occurrences

Set the current stream position.

Parameters:

  pPosition | Number of bytes from the beginning of the stream to seek to.

virtual int GetError | ( |  | ) | const`[pure virtual]`

Search for all occurrences

Return 0 if no errors occurred.

Otherwise, return 1 to indicate an error. This method will be invoked whenever FBX needs to verify that the last operation succeeded.

virtual void ClearError | ( |  | ) | `[pure virtual]`

Search for all occurrences

Clear current error condition by setting the current error value to 0.

int Write | ( | const char * | pData,
|  | int | pSize
| ) |  | `[inline]`

Search for all occurrences

Definition at line 117 of file fbxstream.h.

    { return Write((void*)pData, pSize); }

int Write | ( | const int * | pData,
|  | int | pSize
| ) |  | `[inline]`

Search for all occurrences

Definition at line 118 of file fbxstream.h.

    { return Write((void*)pData, pSize); }

int Read | ( | char * | pData,
|  | int | pSize
| ) |  | const`[inline]`

Search for all occurrences

Definition at line 119 of file fbxstream.h.

    { return Read((void*)pData, pSize); }

int Read | ( | int * | pData,
|  | int | pSize
| ) |  | const`[inline]`

Search for all occurrences

Definition at line 120 of file fbxstream.h.

    { return Read((void*)pData, pSize); }

The documentation for this class was generated from the following file:

- fbxsdk/core/fbxstream.h

FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream
FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream FbxStream