make readFromFileV2() return bool for file exists

This commit is contained in:
ZappoMan 2013-05-04 09:41:10 -07:00
parent 89eefe461d
commit 6a32424fb2
2 changed files with 4 additions and 2 deletions

View file

@ -865,7 +865,7 @@ int VoxelTree::encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEnco
return bytesAtThisLevel; return bytesAtThisLevel;
} }
void VoxelTree::readFromFileV2(const char* fileName, bool reset) { bool VoxelTree::readFromFileV2(const char* fileName) {
std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate); std::ifstream file(fileName, std::ios::in|std::ios::binary|std::ios::ate);
if(file.is_open()) { if(file.is_open()) {
printLog("loading file...\n"); printLog("loading file...\n");
@ -881,7 +881,9 @@ void VoxelTree::readFromFileV2(const char* fileName, bool reset) {
delete[] entireFile; delete[] entireFile;
file.close(); file.close();
return true;
} }
return false;
} }
void VoxelTree::writeToFileV2(const char* fileName) const { void VoxelTree::writeToFileV2(const char* fileName) const {

View file

@ -67,7 +67,7 @@ public:
// these will read/write files that match the wireformat, excluding the 'V' leading // these will read/write files that match the wireformat, excluding the 'V' leading
void writeToFileV2(const char* filename) const; void writeToFileV2(const char* filename) const;
void readFromFileV2(const char* filename, bool reset); bool readFromFileV2(const char* filename);
private: private:
int encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEncodeLevel, int encodeTreeBitstreamRecursion(int maxEncodeLevel, int& currentEncodeLevel,