- Timestamp:
- 05/22/06 18:32:12 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.cpp
r971 r975 66 66 67 67 #include "GzBinFileInputStream.h" 68 #include "common.h" 68 69 69 70 XERCES_CPP_NAMESPACE_BEGIN … … 74 75 GzBinFileInputStream::GzBinFileInputStream(const XMLCh* const fileName 75 76 , MemoryManager* const manager) : 76 77 //fSource(0) , 78 fMemoryManager(manager)77 //fSource(0) , 78 fMemoryManager(manager), 79 mCurrentPos(0) 79 80 { 80 81 // Try to open the file 81 //fSource = XMLPlatformUtils::openFile((unsignedfileName, manager); 82 //fSource = XMLPlatformUtils::openFile(fileName, manager); 83 // todo: delete xmlstring 82 84 char *myFileName = XMLString::transcode(fileName); 85 //mStream.open(myFileName, ios::binary); 83 86 mStream.open(myFileName); 84 87 } … … 86 89 GzBinFileInputStream::GzBinFileInputStream(const char* const fileName, 87 90 MemoryManager* const manager) : 88 fMemoryManager(manager) 91 fMemoryManager(manager), 92 mCurrentPos(0) 89 93 { 90 94 // Try to open the file 95 //mStream.open(fileName, ios::binary); 91 96 mStream.open(fileName); 92 97 } … … 123 128 unsigned int GzBinFileInputStream::curPos() const 124 129 { 125 return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 130 //return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 131 return mCurrentPos; 126 132 } 127 133 128 unsigned int 129 GzBinFileInputStream::readBytes( XMLByte* const toFill 130 , const unsigned int maxToRead) 134 unsigned int GzBinFileInputStream::readBytes(XMLByte* const toFill, 135 const unsigned int maxToRead) 131 136 { 132 137 // … … 134 139 // actually read. 135 140 // 136 //return XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 137 mStream.getline((char *)toFill, maxToRead); 138 return mStream.gcount(); 141 //unsigned int result = XMLPlatformUtils::readFileBuffer(fSource, maxToRead, toFill, fMemoryManager); 142 mStream.read((char *)toFill, maxToRead); 143 144 unsigned int result = mStream.gcount(); 145 mCurrentPos = mStream.tellg(); 146 //GtpVisibilityPreprocessor::Debug << "here1001 " << maxToRead << " haha " << toFill << " " << result << endl; 147 148 return result; 139 149 } 140 150
Note: See TracChangeset
for help on using the changeset viewer.