00001 /* 00002 * Copyright (C) 2010 Regents of the University of Michigan 00003 * 00004 * This program is free software: you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation, either version 3 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 */ 00017 00018 #include "FastQ.h" 00019 00020 void FastQ::read(std::istream &stream) 00021 { 00022 std::getline(stream, tag); 00023 std::getline(stream, data); 00024 std::getline(stream, tag2); 00025 std::getline(stream, quality); 00026 if (stream.eof()) 00027 { 00028 clear(); 00029 } 00030 else valid=true; 00031 } 00032 00033 void FastQ::write(std::ostream &stream) 00034 { 00035 if (valid) 00036 { 00037 stream << tag << std::endl; 00038 stream << data << std::endl; 00039 stream << tag2 << std::endl; 00040 stream << quality << std::endl; 00041 } 00042 } 00043 00044