Ignore:
Timestamp:
05/22/06 18:32:12 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/GzBinFileInputStream.cpp

    r971 r975  
    6666 
    6767#include "GzBinFileInputStream.h" 
     68#include "common.h" 
    6869 
    6970XERCES_CPP_NAMESPACE_BEGIN 
     
    7475GzBinFileInputStream::GzBinFileInputStream(const XMLCh* const fileName 
    7576                                       , MemoryManager* const manager) : 
    76  
    77     //fSource(0) ,  
    78 fMemoryManager(manager) 
     77//fSource(0) , 
     78fMemoryManager(manager), 
     79mCurrentPos(0) 
    7980{ 
    8081        // Try to open the file 
    81     //fSource = XMLPlatformUtils::openFile((unsignedfileName, manager); 
     82    //fSource = XMLPlatformUtils::openFile(fileName, manager); 
     83        // todo: delete xmlstring 
    8284        char *myFileName = XMLString::transcode(fileName); 
     85        //mStream.open(myFileName, ios::binary); 
    8386        mStream.open(myFileName); 
    8487} 
     
    8689GzBinFileInputStream::GzBinFileInputStream(const char* const fileName, 
    8790                                                                                   MemoryManager* const manager) : 
    88 fMemoryManager(manager) 
     91fMemoryManager(manager), 
     92mCurrentPos(0) 
    8993{ 
    9094    // Try to open the file 
     95        //mStream.open(fileName, ios::binary); 
    9196        mStream.open(fileName); 
    9297} 
     
    123128unsigned int GzBinFileInputStream::curPos() const 
    124129{ 
    125     return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 
     130    //return XMLPlatformUtils::curFilePos(fSource, fMemoryManager); 
     131        return mCurrentPos; 
    126132} 
    127133 
    128 unsigned int 
    129 GzBinFileInputStream::readBytes(          XMLByte* const  toFill 
    130                                 , const unsigned int    maxToRead) 
     134unsigned int GzBinFileInputStream::readBytes(XMLByte* const  toFill,  
     135                                                                                         const unsigned int maxToRead) 
    131136{ 
    132137    // 
     
    134139    //  actually read. 
    135140    // 
    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; 
    139149} 
    140150 
Note: See TracChangeset for help on using the changeset viewer.