Bullet Collision Detection & Physics Library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
bParse::bFile Class Referenceabstract

#include <bFile.h>

Inheritance diagram for bParse::bFile:
Inheritance graph
[legend]
Collaboration diagram for bParse::bFile:
Collaboration graph
[legend]

Public Member Functions

 bFile (const char *filename, const char headerString[7])
 
 bFile (char *memoryBuffer, int len, const char headerString[7])
 
virtual ~bFile ()
 
bDNAgetFileDNA ()
 
virtual void addDataBlock (char *dataBlock)=0
 
int getFlags () const
 
void setFileDNAisMemoryDNA ()
 
bPtrMapgetLibPointers ()
 
void * findLibPointer (void *ptr)
 
bool ok ()
 
virtual void parse (int verboseMode)=0
 
virtual int write (const char *fileName, bool fixupPointers=false)=0
 
virtual void writeChunks (FILE *fp, bool fixupPointers)
 
virtual void writeDNA (FILE *fp)=0
 
void updateOldPointers ()
 
void resolvePointers (int verboseMode)
 Resolve pointers replaces the original pointers in structures, and linked lists by the new in-memory structures. More...
 
void dumpChunks (bDNA *dna)
 
virtual void setFileDNA (int verboseMode, char *buffer, int len)
 
int getVersion () const
 
void preSwap ()
 
void writeFile (const char *fileName)
 

Protected Member Functions

int getNextBlock (bChunkInd *dataChunk, const char *dataPtr, const int flags)
 
void safeSwapPtr (char *dst, const char *src)
 
virtual void parseHeader ()
 
virtual void parseData ()=0
 
void resolvePointersMismatch ()
 
void resolvePointersChunk (const bChunkInd &dataChunk, int verboseMode)
 this loop only works fine if the Blender DNA structure of the file matches the headerfiles More...
 
int resolvePointersStructRecursive (char *strcPtr, int old_dna, int verboseMode, int recursion)
 
void parseStruct (char *strcPtr, char *dtPtr, int old_dna, int new_dna, bool fixupPointers)
 
void getMatchingFileDNA (short *old, const char *lookupName, const char *lookupType, char *strcData, char *data, bool fixupPointers)
 
char * getFileElement (short *firstStruct, char *lookupName, char *lookupType, char *data, short **foundPos)
 
void swap (char *head, class bChunkInd &ch, bool ignoreEndianFlag)
 
void swapData (char *data, short type, int arraySize, bool ignoreEndianFlag)
 
void swapStruct (int dna_nr, char *data, bool ignoreEndianFlag)
 
void swapLen (char *dataPtr)
 
void swapDNA (char *ptr)
 
char * readStruct (char *head, class bChunkInd &chunk)
 
char * getAsString (int code)
 
virtual void parseInternal (int verboseMode, char *memDna, int memDnaLength)
 

Protected Attributes

char m_headerString [7]
 
bool mOwnsBuffer
 
char * mFileBuffer
 
int mFileLen
 
int mVersion
 
bPtrMap mLibPointers
 
int mDataStart
 
bDNAmFileDNA
 
bDNAmMemoryDNA
 
btAlignedObjectArray< char * > m_pointerFixupArray
 
btAlignedObjectArray< char * > m_pointerPtrFixupArray
 
btAlignedObjectArray< bChunkIndm_chunks
 
btHashMap< btHashPtr, bChunkIndm_chunkPtrPtrMap
 
bPtrMap mDataPointers
 
int mFlags
 

Detailed Description

Definition at line 48 of file bFile.h.

Constructor & Destructor Documentation

bFile::bFile ( const char *  filename,
const char  headerString[7] 
)

Definition at line 55 of file bFile.cpp.

bFile::bFile ( char *  memoryBuffer,
int  len,
const char  headerString[7] 
)

Definition at line 89 of file bFile.cpp.

bFile::~bFile ( )
virtual

Definition at line 112 of file bFile.cpp.

Member Function Documentation

virtual void bParse::bFile::addDataBlock ( char *  dataBlock)
pure virtual

Implemented in bParse::btBulletFile.

void bFile::dumpChunks ( bParse::bDNA dna)

Definition at line 1546 of file bFile.cpp.

void * bFile::findLibPointer ( void *  ptr)

Definition at line 1526 of file bFile.cpp.

char* bParse::bFile::getAsString ( int  code)
protected
bDNA* bParse::bFile::getFileDNA ( )
inline

Definition at line 120 of file bFile.h.

char * bFile::getFileElement ( short *  firstStruct,
char *  lookupName,
char *  lookupType,
char *  data,
short **  foundPos 
)
protected

Definition at line 1101 of file bFile.cpp.

int bParse::bFile::getFlags ( ) const
inline

Definition at line 127 of file bFile.h.

bPtrMap& bParse::bFile::getLibPointers ( )
inline

Definition at line 137 of file bFile.h.

void bFile::getMatchingFileDNA ( short *  old,
const char *  lookupName,
const char *  lookupType,
char *  strcData,
char *  data,
bool  fixupPointers 
)
protected

Definition at line 1014 of file bFile.cpp.

int bFile::getNextBlock ( bChunkInd dataChunk,
const char *  dataPtr,
const int  flags 
)
protected

Definition at line 1657 of file bFile.cpp.

int bParse::bFile::getVersion ( ) const
inline

Definition at line 161 of file bFile.h.

bool bFile::ok ( )

Definition at line 185 of file bFile.cpp.

virtual void bParse::bFile::parse ( int  verboseMode)
pure virtual

Implemented in bParse::btBulletFile.

virtual void bParse::bFile::parseData ( )
protectedpure virtual

Implemented in bParse::btBulletFile.

void bFile::parseHeader ( )
protectedvirtual

Definition at line 130 of file bFile.cpp.

void bFile::parseInternal ( int  verboseMode,
char *  memDna,
int  memDnaLength 
)
protectedvirtual

mFileDNA->init will convert part of DNA file endianness to current CPU endianness if necessary

Definition at line 202 of file bFile.cpp.

void bFile::parseStruct ( char *  strcPtr,
char *  dtPtr,
int  old_dna,
int  new_dna,
bool  fixupPointers 
)
protected

Definition at line 798 of file bFile.cpp.

void bFile::preSwap ( )

Definition at line 590 of file bFile.cpp.

char * bFile::readStruct ( char *  head,
class bChunkInd chunk 
)
protected

don't try to convert Link block data, just memcpy it. Other data can be converted.

Definition at line 673 of file bFile.cpp.

void bFile::resolvePointers ( int  verboseMode)

Resolve pointers replaces the original pointers in structures, and linked lists by the new in-memory structures.

Definition at line 1474 of file bFile.cpp.

void bFile::resolvePointersChunk ( const bChunkInd dataChunk,
int  verboseMode 
)
protected

this loop only works fine if the Blender DNA structure of the file matches the headerfiles

Definition at line 1245 of file bFile.cpp.

void bFile::resolvePointersMismatch ( )
protected

Definition at line 1177 of file bFile.cpp.

int bFile::resolvePointersStructRecursive ( char *  strcPtr,
int  old_dna,
int  verboseMode,
int  recursion 
)
protected

Definition at line 1262 of file bFile.cpp.

void bFile::safeSwapPtr ( char *  dst,
const char *  src 
)
protected

Definition at line 955 of file bFile.cpp.

void bFile::setFileDNA ( int  verboseMode,
char *  buffer,
int  len 
)
virtual

mFileDNA->init will convert part of DNA file endianness to current CPU endianness if necessary

Definition at line 190 of file bFile.cpp.

void bParse::bFile::setFileDNAisMemoryDNA ( )
inline

Definition at line 132 of file bFile.h.

void bFile::swap ( char *  head,
class bChunkInd ch,
bool  ignoreEndianFlag 
)
protected

Definition at line 326 of file bFile.cpp.

void bFile::swapData ( char *  data,
short  type,
int  arraySize,
bool  ignoreEndianFlag 
)
protected

Definition at line 922 of file bFile.cpp.

void bFile::swapDNA ( char *  ptr)
protected

Definition at line 405 of file bFile.cpp.

void bFile::swapLen ( char *  dataPtr)
protected

Definition at line 355 of file bFile.cpp.

void bFile::swapStruct ( int  dna_nr,
char *  data,
bool  ignoreEndianFlag 
)
protected

Definition at line 1130 of file bFile.cpp.

void bFile::updateOldPointers ( )

Definition at line 1536 of file bFile.cpp.

virtual int bParse::bFile::write ( const char *  fileName,
bool  fixupPointers = false 
)
pure virtual

Implemented in bParse::btBulletFile.

void bFile::writeChunks ( FILE *  fp,
bool  fixupPointers 
)
virtual

don't try to convert Link block data, just memcpy it. Other data can be converted.

Definition at line 1593 of file bFile.cpp.

virtual void bParse::bFile::writeDNA ( FILE *  fp)
pure virtual

Implemented in bParse::btBulletFile.

void bFile::writeFile ( const char *  fileName)

Definition at line 583 of file bFile.cpp.

Member Data Documentation

btHashMap<btHashPtr, bChunkInd> bParse::bFile::m_chunkPtrPtrMap
protected

Definition at line 70 of file bFile.h.

btAlignedObjectArray<bChunkInd> bParse::bFile::m_chunks
protected

Definition at line 69 of file bFile.h.

char bParse::bFile::m_headerString[7]
protected

Definition at line 52 of file bFile.h.

btAlignedObjectArray<char*> bParse::bFile::m_pointerFixupArray
protected

Definition at line 66 of file bFile.h.

btAlignedObjectArray<char*> bParse::bFile::m_pointerPtrFixupArray
protected

Definition at line 67 of file bFile.h.

bPtrMap bParse::bFile::mDataPointers
protected

Definition at line 74 of file bFile.h.

int bParse::bFile::mDataStart
protected

Definition at line 62 of file bFile.h.

char* bParse::bFile::mFileBuffer
protected

Definition at line 55 of file bFile.h.

bDNA* bParse::bFile::mFileDNA
protected

Definition at line 63 of file bFile.h.

int bParse::bFile::mFileLen
protected

Definition at line 56 of file bFile.h.

int bParse::bFile::mFlags
protected

Definition at line 77 of file bFile.h.

bPtrMap bParse::bFile::mLibPointers
protected

Definition at line 60 of file bFile.h.

bDNA* bParse::bFile::mMemoryDNA
protected

Definition at line 64 of file bFile.h.

bool bParse::bFile::mOwnsBuffer
protected

Definition at line 54 of file bFile.h.

int bParse::bFile::mVersion
protected

Definition at line 57 of file bFile.h.


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