• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MikkelSchubert / adapterremoval / #45

20 Sep 2024 06:49PM UTC coverage: 26.244% (-49.2%) from 75.443%
#45

push

travis-ci

web-flow
attempt to fix coveralls run

2458 of 9366 relevant lines covered (26.24%)

4362.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/linereader_joined.cpp
1
/*************************************************************************\
2
 * AdapterRemoval - cleaning next-generation sequencing reads            *
3
 *                                                                       *
4
 * Copyright (C) 2015 by Mikkel Schubert - mikkelsch@gmail.com           *
5
 *                                                                       *
6
 * This program is free software: you can redistribute it and/or modify  *
7
 * it under the terms of the GNU General Public License as published by  *
8
 * the Free Software Foundation, either version 3 of the License, or     *
9
 * (at your option) any later version.                                   *
10
 *                                                                       *
11
 * This program is distributed in the hope that it will be useful,       *
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
 * GNU General Public License for more details.                          *
15
 *                                                                       *
16
 * You should have received a copy of the GNU General Public License     *
17
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. *
18
\*************************************************************************/
19
#include "linereader_joined.hpp"
20
#include <memory> // for make_unique
21
#include <vector> // for vector
22

23
namespace adapterremoval {
24

25
joined_line_readers::joined_line_readers(const string_vec& filenames)
×
26
  : m_filenames(filenames.rbegin(), filenames.rend())
×
27
{
28
}
29

30
bool
31
joined_line_readers::getline(std::string& dst)
×
32
{
33
  while (true) {
×
34
    if (m_reader && m_reader->getline(dst)) {
×
35
      m_current_line++;
×
36
      return true;
×
37
    } else if (!open_next_file()) {
×
38
      return false;
39
    }
40
  }
41
}
42

43
bool
44
joined_line_readers::open_next_file()
×
45
{
46
  if (m_filenames.empty()) {
×
47
    m_reader.reset();
×
48
    return false;
×
49
  }
50

51
  m_reader = std::make_unique<line_reader>(m_filenames.back());
×
52
  m_filename = m_filenames.back();
×
53
  m_current_line = 1;
×
54

55
  m_filenames.pop_back();
×
56

57
  return true;
×
58
}
59

60
} // namespace adapterremoval
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc