Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PhdParser Class Reference

#include <phdparser.h>

List of all members.

Public Member Functions

 PhdParser (std::string infile)
TrapperVector< Q_UINT32 > parse ()

Private Attributes

std::string filename


Detailed Description

Definition at line 7 of file phdparser.h.


Constructor & Destructor Documentation

PhdParser::PhdParser std::string  infile  ) 
 


Member Function Documentation

TrapperVector< Q_UINT32 > PhdParser::parse  ) 
 

Definition at line 12 of file phdparser.cc.

References filename, and TrapperVector< T >::stlVector().

Referenced by TrapperDoc::importPhd().

00013 {
00014   TrapperVector<Q_UINT32> phd;
00015   
00016   string line;
00017   
00018   ifstream inFile(filename.c_str());
00019   
00020   while ( getline(inFile, line) ) {
00021     if ( line == "BEGIN_DNA" ) break;
00022   }
00023   while ( getline(inFile, line) ) {
00024     if ( line == "END_DNA" ) break;
00025     
00026     istringstream is(line);
00027     char base;
00028     size_t qual;
00029     size_t index;
00030     if ( !(is>>base && is>>qual && is>>index) ) {
00031       cerr<<"PhdParser::parse(), input error"<<endl;
00032       cerr<<"Line is ill formated"<<endl;
00033       cerr<<line<<endl;
00034       return TrapperVector<Q_UINT32>();
00035     }
00036     phd.stlVector().push_back(index);
00037     
00038   }
00039   inFile.close();
00040   return phd;
00041 }


Member Data Documentation

std::string PhdParser::filename [private]
 

Definition at line 15 of file phdparser.h.

Referenced by parse().


The documentation for this class was generated from the following files:
Generated on Fri Mar 17 17:45:00 2006 for trapper by  doxygen 1.4.4