fbxsdk/core/base/fbxfile.h File Reference

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.

215 {
216  switch( sizeof(x) )
217  {
218  case 2:
219  {
220  FbxUInt8 t[2];
221  t[0] = ((FbxUInt8*)&x)[1];
222  t[1] = ((FbxUInt8*)&x)[0];
223  return *(T*)&t;
224  }
225 
226  case 4:
227  {
228  FbxUInt8 t[4];
229  t[0] = ((FbxUInt8*)&x)[3];
230  t[1] = ((FbxUInt8*)&x)[2];
231  t[2] = ((FbxUInt8*)&x)[1];
232  t[3] = ((FbxUInt8*)&x)[0];
233  return *(T*)&t;
234  }
235 
236  case 8:
237  {
238  FbxUInt8 t[8];
239  t[0] = ((FbxUInt8*)&x)[7];
240  t[1] = ((FbxUInt8*)&x)[6];
241  t[2] = ((FbxUInt8*)&x)[5];
242  t[3] = ((FbxUInt8*)&x)[4];
243  t[4] = ((FbxUInt8*)&x)[3];
244  t[5] = ((FbxUInt8*)&x)[2];
245  t[6] = ((FbxUInt8*)&x)[1];
246  t[7] = ((FbxUInt8*)&x)[0];
247  return *(T*)&t;
248  }
249 
250  default:
251  return x;
252  }
253 }
unsigned char FbxUInt8
Definition: fbxtypes.h:76

Go to the source code of this file.