fbxsdk/core/base/fbxfile.h File Reference
 
 
 
fbxsdk/core/base/fbxfile.h File Reference

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



File Description

Definition in file fbxfile.h.

Classes

class   FbxFile
  Class for interfacing with files, providing a similar interface for files independant of the OS or filesystem. More...
class   FbxFileUtils

Functions

template<class T >
const T  FbxSwab (const T x)

Function Documentation

const T FbxSwab ( const T  x ) [inline]

Definition at line 214 of file fbxfile.h.

{
        switch( sizeof(x) )
        {
                case 2:
                {
                        FbxUInt8 t[2];
                        t[0] = ((FbxUInt8*)&x)[1];
                        t[1] = ((FbxUInt8*)&x)[0];
                        return *(T*)&t;
                }

                case 4:
                {
                        FbxUInt8 t[4];
                        t[0] = ((FbxUInt8*)&x)[3];
                        t[1] = ((FbxUInt8*)&x)[2];
                        t[2] = ((FbxUInt8*)&x)[1];
                        t[3] = ((FbxUInt8*)&x)[0];
                        return *(T*)&t;
                }

                case 8:
                {
                        FbxUInt8 t[8];
                        t[0] = ((FbxUInt8*)&x)[7];
                        t[1] = ((FbxUInt8*)&x)[6];
                        t[2] = ((FbxUInt8*)&x)[5];
                        t[3] = ((FbxUInt8*)&x)[4];
                        t[4] = ((FbxUInt8*)&x)[3];
                        t[5] = ((FbxUInt8*)&x)[2];
                        t[6] = ((FbxUInt8*)&x)[1];
                        t[7] = ((FbxUInt8*)&x)[0];
                        return *(T*)&t;
                }

                default:
                        return x;
        }
}

Go to the source code of this file.