Attachment 'ReaderParser.cc'

Download

   1 #include "ReaderParser.hh"
   2 #include <iostream>
   3 #include <algorithm>
   4 #include <iterator>
   5 
   6 
   7 ReaderParser::ReaderParser()
   8 {
   9   registerTokenHandler( "outfile"  , &ReaderParser::parseOutFileToken   );
  10   registerTokenHandler( "pairsfile", &ReaderParser::parsePairsFileToken );
  11   registerTokenHandler( "file1"    , &ReaderParser::parseFile1Token     );
  12   registerTokenHandler( "file2"    , &ReaderParser::parseFile2Token     );
  13 }
  14 
  15 
  16 bool ReaderParser::parseOutFileToken( std::string& file )
  17 {
  18   outfilename = file;
  19   return true;
  20 }
  21 bool ReaderParser::parsePairsFileToken( std::string& file )
  22 {
  23   pairsfilename = file;
  24   return true;
  25 }
  26 bool ReaderParser::parseFile1Token( std::string& file )
  27 {
  28   list1.push_back( file );
  29   return true;
  30 }
  31 bool ReaderParser::parseFile2Token( std::string& file )
  32 {
  33   list2.push_back( file );
  34   return true;
  35 }
  36 
  37 
  38 
  39 std::ostream& operator<<(std::ostream& out, const ReaderParser& steer)
  40 {
  41   out << "OutFilename:   " << steer.outfilename   << std::endl;
  42   out << "PairsFilename: " << steer.pairsfilename << std::endl;
  43   out << "Files1:"<< std::endl;
  44   std::copy( steer.list1.begin(), steer.list1.end(),
  45 	     std::ostream_iterator<std::string>(out, "\n"));
  46   out << "Files2:"<< std::endl;
  47   std::copy( steer.list2.begin(), steer.list2.end(),
  48 	     std::ostream_iterator<std::string>(out, "\n"));
  49 
  50   return out;
  51 }

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2009-04-15 11:34:30, 1.3 KB) [[attachment:ReaderParser.cc]]
  • [get | view] (2009-04-15 11:34:36, 0.6 KB) [[attachment:ReaderParser.hh]]
  • [get | view] (2009-04-15 11:33:32, 1.9 KB) [[attachment:SimpleParserBase.cc]]
  • [get | view] (2009-04-15 11:34:07, 2.2 KB) [[attachment:SimpleParserBase.hh]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.