37 if (m_buffer_pos >= m_buffer_size)
39 m_buffer_size =
read( &m_buffer[0], (
uint32)m_buffer.size() );
42 return (m_buffer_pos < m_buffer_size) ? m_buffer[ m_buffer_pos++ ] :
FASTQ_EOF;
50 m_buffer( buffer_size ),
59 : m_buffer( buffer_size ), m_buffer_size( 0 ), m_buffer_pos( 0 )
61 m_file = fopen( filename,
"r" );
72 m_file = fopen( filename,
"r" );
89 if (m_buffer_pos >= m_buffer_size)
91 m_buffer_size = (
uint32)fread( &m_buffer[0],
sizeof(
uint8), m_buffer.size(), m_file );
94 return (m_buffer_pos < m_buffer_size) ? m_buffer[ m_buffer_pos++ ] :
FASTQ_EOF;
99 template <
typename FASTQ_stream>
108 template <
typename FASTQ_stream>
109 template <
typename Writer>
136 m_error_char = marker;
141 m_name.erase( m_name.begin(), m_name.end() );
142 for (
uint8 c =
get(); c !=
'\n'; c =
get())
146 log_error(stderr,
"incomplete read at EOF!\n");
147 m_name.erase(m_name.begin(), m_name.end());
157 m_name.push_back(
'\0');
162 m_read_bp.erase( m_read_bp.begin(), m_read_bp.end() );
163 for (
uint8 c =
get(); c !=
'+'; c =
get())
167 log_error(stderr,
"incomplete read at EOF!\n");
168 m_name.erase(m_name.begin(), m_name.end());
176 m_read_bp.push_back( c );
183 for(
uint8 c =
get(); c !=
'\n'; c =
get())
187 log_error(stderr,
"incomplete read at EOF!\n");
188 m_name.erase(m_name.begin(), m_name.end());
189 m_read_bp.erase(m_read_bp.begin(), m_read_bp.end());
201 m_read_q.erase( m_read_q.begin(), m_read_q.end() );
202 for (
uint8 c =
get(); c !=
'\n'; c =
get())
206 log_error(stderr,
"incomplete read at EOF!\n");
207 m_name.erase(m_name.begin(), m_name.end());
208 m_read_bp.erase(m_read_bp.begin(), m_read_bp.end());
215 m_read_q.push_back( c );
221 uint32( m_read_bp.size() ),
233 template <
typename FASTQ_stream>
237 sprintf(error,
"line %u, expected '@', got '%c'", m_line, m_error_char);
239 sprintf(error,
"line %u, expected '+', got '%c'", m_line, m_error_char);