Bullet Collision Detection & Physics Library: bParse::bFile Class Reference

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:
[legend]
Collaboration diagram for bParse::bFile:
[legend]

## Public Member Functions
| bFile (const char *filename, const char headerString[7])
| bFile (char *memoryBuffer, int len, const char headerString[7])
virtual | ~bFile ()
bDNA * | getFileDNA ()
virtual void | addDataBlock (char *dataBlock)=0
int | getFlags () const
void | setFileDNAisMemoryDNA ()
bPtrMap & | getLibPointers ()
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
bDNA * | mFileDNA
bDNA * | mMemoryDNA
btAlignedObjectArray< char * > | m_pointerFixupArray
btAlignedObjectArray< char * > | m_pointerPtrFixupArray
btAlignedObjectArray< bChunkInd > | m_chunks
btHashMap< btHashPtr, bChunkInd > | m_chunkPtrPtrMap
bPtrMap | mDataPointers
int | mFlags

## Detailed Description

Definition at line 48 of file bFile.h.

## Constructor & Destructor Documentation

## ◆ bFile() [1/2]

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

Definition at line 55 of file bFile.cpp.

## ◆ bFile() [2/2]

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

Definition at line 90 of file bFile.cpp.

## ◆ ~bFile()

bFile::~bFile | ( |  | ) |
| virtual

Definition at line 113 of file bFile.cpp.

## Member Function Documentation

## ◆ addDataBlock()

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

Implemented in bParse::btBulletFile.

## ◆ dumpChunks()

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

Definition at line 1530 of file bFile.cpp.

## ◆ findLibPointer()

void * bFile::findLibPointer | ( | void * | ptr | ) |

Definition at line 1510 of file bFile.cpp.

## ◆ getAsString()

char* bParse::bFile::getAsString | ( | int | code | ) |
| protected

## ◆ getFileDNA()

bDNA* bParse::bFile::getFileDNA | ( |  | ) |
| inline

Definition at line 120 of file bFile.h.

## ◆ getFileElement()

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

Definition at line 1085 of file bFile.cpp.

## ◆ getFlags()

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

Definition at line 127 of file bFile.h.

## ◆ getLibPointers()

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

Definition at line 137 of file bFile.h.

## ◆ getMatchingFileDNA()

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

Definition at line 998 of file bFile.cpp.

## ◆ getNextBlock()

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

Definition at line 1641 of file bFile.cpp.

## ◆ getVersion()

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

Definition at line 161 of file bFile.h.

## ◆ ok()

bool bFile::ok | ( |  | ) |

Definition at line 186 of file bFile.cpp.

## ◆ parse()

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

Implemented in bParse::btBulletFile.

## ◆ parseData()

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

Implemented in bParse::btBulletFile.

## ◆ parseHeader()

void bFile::parseHeader | ( |  | ) |
| protectedvirtual

Definition at line 131 of file bFile.cpp.

## ◆ parseInternal()

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 203 of file bFile.cpp.

## ◆ parseStruct()

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

Definition at line 782 of file bFile.cpp.

## ◆ preSwap()

void bFile::preSwap | ( |  | ) |

Definition at line 574 of file bFile.cpp.

## ◆ readStruct()

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 657 of file bFile.cpp.

## ◆ resolvePointers()

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 1458 of file bFile.cpp.

## ◆ resolvePointersChunk()

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 1229 of file bFile.cpp.

## ◆ resolvePointersMismatch()

void bFile::resolvePointersMismatch | ( |  | ) |
| protected

Definition at line 1161 of file bFile.cpp.

## ◆ resolvePointersStructRecursive()

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

Definition at line 1246 of file bFile.cpp.

## ◆ safeSwapPtr()

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

Definition at line 939 of file bFile.cpp.

## ◆ setFileDNA()

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 191 of file bFile.cpp.

## ◆ setFileDNAisMemoryDNA()

void bParse::bFile::setFileDNAisMemoryDNA | ( |  | ) |
| inline

Definition at line 132 of file bFile.h.

## ◆ swap()

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

Definition at line 327 of file bFile.cpp.

## ◆ swapData()

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

Definition at line 906 of file bFile.cpp.

## ◆ swapDNA()

void bFile::swapDNA | ( | char * | ptr | ) |
| protected

Definition at line 406 of file bFile.cpp.

## ◆ swapLen()

void bFile::swapLen | ( | char * | dataPtr | ) |
| protected

Definition at line 356 of file bFile.cpp.

## ◆ swapStruct()

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

Definition at line 1114 of file bFile.cpp.

## ◆ updateOldPointers()

void bFile::updateOldPointers | ( |  | ) |

Definition at line 1520 of file bFile.cpp.

## ◆ write()

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

Implemented in bParse::btBulletFile.

## ◆ writeChunks()

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 1577 of file bFile.cpp.

## ◆ writeDNA()

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

Implemented in bParse::btBulletFile.

## ◆ writeFile()

void bFile::writeFile | ( | const char * | fileName | ) |

Definition at line 567 of file bFile.cpp.

## Member Data Documentation

## ◆ m_chunkPtrPtrMap

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

Definition at line 70 of file bFile.h.

## ◆ m_chunks

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

Definition at line 69 of file bFile.h.

## ◆ m_headerString

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

Definition at line 52 of file bFile.h.

## ◆ m_pointerFixupArray

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

Definition at line 66 of file bFile.h.

## ◆ m_pointerPtrFixupArray

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

Definition at line 67 of file bFile.h.

## ◆ mDataPointers

bPtrMap bParse::bFile::mDataPointers
| protected

Definition at line 74 of file bFile.h.

## ◆ mDataStart

int bParse::bFile::mDataStart
| protected

Definition at line 62 of file bFile.h.

## ◆ mFileBuffer

char* bParse::bFile::mFileBuffer
| protected

Definition at line 55 of file bFile.h.

## ◆ mFileDNA

bDNA* bParse::bFile::mFileDNA
| protected

Definition at line 63 of file bFile.h.

## ◆ mFileLen

int bParse::bFile::mFileLen
| protected

Definition at line 56 of file bFile.h.

## ◆ mFlags

int bParse::bFile::mFlags
| protected

Definition at line 77 of file bFile.h.

## ◆ mLibPointers

bPtrMap bParse::bFile::mLibPointers
| protected

Definition at line 60 of file bFile.h.

## ◆ mMemoryDNA

bDNA* bParse::bFile::mMemoryDNA
| protected

Definition at line 64 of file bFile.h.

## ◆ mOwnsBuffer

bool bParse::bFile::mOwnsBuffer
| protected

Definition at line 54 of file bFile.h.

## ◆ mVersion

int bParse::bFile::mVersion
| protected

Definition at line 57 of file bFile.h.

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

- bFile.h
- bFile.cpp