ifstreamSSAHA Class Reference

#include <GlobalDefinitions.h>

List of all members.

Public Member Functions

 ifstreamSSAHA (const char *fileName, unsigned long chunkSize=maxChunkSize)
istream & read (const char *p, unsigned long s)
unsigned long gcount (void) const

Protected Attributes

unsigned long chunkSize_
unsigned long bytesSoFar_

Static Private Attributes

static const unsigned long maxChunkSize = ( ((unsigned long)1<<31)-1 )


Detailed Description

Definition at line 488 of file GlobalDefinitions.h.


Constructor & Destructor Documentation

ifstreamSSAHA::ifstreamSSAHA ( const char *  fileName,
unsigned long  chunkSize = maxChunkSize 
) [inline]

Definition at line 496 of file GlobalDefinitions.h.

00497     : std::ifstream( fileName ), chunkSize_( chunkSize ) {}


Member Function Documentation

istream& ifstreamSSAHA::read ( const char *  p,
unsigned long  s 
) [inline]

Definition at line 499 of file GlobalDefinitions.h.

References bytesSoFar_, and maxChunkSize.

00500   {
00501     bytesSoFar_=0;
00502     while ( s > maxChunkSize )
00503     {
00504       std::ifstream::read((char*)p,maxChunkSize); 
00505       p+=maxChunkSize;
00506       s-=maxChunkSize;
00507       bytesSoFar_+=std::ifstream::gcount();
00508     } // ~while
00509     std::ifstream::read((char*)p,s);
00510     bytesSoFar_+=std::ifstream::gcount();
00511     //    cout << "!!!read " << bytesSoFar_ << endl; 
00512     return *this;
00513   } // ~read

unsigned long ifstreamSSAHA::gcount ( void   )  const [inline]

Definition at line 515 of file GlobalDefinitions.h.

References bytesSoFar_.

00516     { return bytesSoFar_; }


Member Data Documentation

const unsigned long ifstreamSSAHA::maxChunkSize = ( ((unsigned long)1<<31)-1 ) [static, private]

Definition at line 490 of file GlobalDefinitions.h.

Referenced by read().

unsigned long ifstreamSSAHA::chunkSize_ [protected]

Definition at line 520 of file GlobalDefinitions.h.

unsigned long ifstreamSSAHA::bytesSoFar_ [protected]

Definition at line 521 of file GlobalDefinitions.h.

Referenced by gcount(), and read().


The documentation for this class was generated from the following file:
Generated on Fri Dec 21 13:17:46 2007 for ssaha by  doxygen 1.5.2