cgma
NCubitFile Namespace Reference

Classes

struct  SModelData
struct  SElemData
struct  SGroupData
struct  SSideSetData_10
struct  SSideSetData_11
struct  SMaterialData
class  CCubitFile
class  CFEModel
class  CIOWrapper
class  CMetaData
class  CSimModel

Typedefs

typedef unsigned int UnsignedInt32
typedef const char * ConstCharPtr
typedef SGroupData SBlockData
typedef SGroupData SNodeSetData
typedef SGroupData SBCSetData
typedef SGroupData SConstraintData
typedef const UnsignedInt32ConstUnsignedInt32Ptr
typedef const double * ConstDoublePtr

Functions

UnsignedInt32 GetLocation (FILE *f)
int SetLocation (FILE *f, UnsignedInt32 offset, int whence)
template<class T >
void SwapEndian (unsigned int xintCount, T *xpT)

Typedef Documentation

typedef const char* NCubitFile::ConstCharPtr

Definition at line 47 of file CCubitFile.hpp.

typedef const double* NCubitFile::ConstDoublePtr

Definition at line 39 of file CubitFileMetaData.hpp.

Definition at line 38 of file CubitFileMetaData.hpp.

Definition at line 69 of file CCubitFile.hpp.

Definition at line 67 of file CCubitFile.hpp.

Definition at line 70 of file CCubitFile.hpp.

Definition at line 68 of file CCubitFile.hpp.

typedef unsigned int NCubitFile::UnsignedInt32

Definition at line 44 of file CCubitFile.hpp.


Function Documentation

Definition at line 244 of file CubitFileIOWrapper.cpp.

{
#ifdef _MSC_VER
  // normal ftell() returns long, which is a 32 bit signed integer.
  // we use this to increase our 2 GB limit to 4 GB.
  // To go past 4GB, we'd have to use a 64 bit integer instead of UnsignedInt32.
  __int64 offset = _ftelli64(f);
#else
  long offset = ftell(f);
#endif
  if(offset == -1L)
    throw CCubitFile::eFileTellError;
  return static_cast<UnsignedInt32>(offset);
}
int NCubitFile::SetLocation ( FILE *  f,
UnsignedInt32  offset,
int  whence 
)

Definition at line 264 of file CubitFileIOWrapper.cpp.

{
#ifdef _MSC_VER
  return _fseeki64(f, offset, whence);
#else
  return fseek(f, offset, whence);
#endif
}
template<class T >
void NCubitFile::SwapEndian ( unsigned int  xintCount,
T *  xpT 
)

Definition at line 79 of file CubitFileIOWrapper.hpp.

{
    int lintToByte;
    unsigned char* lpCurFromByte;
    unsigned char lachrBuffer[sizeof(T)];
    
    unsigned char* lpCurAtom = (unsigned char*)xpT;
    int lintAtom = xintCount;
    while(lintAtom) {
        lintAtom--;
        lintToByte = sizeof(T);
        lpCurFromByte = lpCurAtom;
        while(lintToByte) {
            lintToByte--;
            lachrBuffer[lintToByte] = *lpCurFromByte;
            lpCurFromByte++;
        }
        memcpy(lpCurAtom, lachrBuffer, sizeof(T));
        lpCurAtom += sizeof(T);
    }
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines