Skip to content

Commit 505d18c

Browse files
Running clang-format on all c++ source files
1 parent 5b9b71f commit 505d18c

25 files changed

+1216
-1485
lines changed

GenomicRegion.cpp

Lines changed: 106 additions & 140 deletions
Large diffs are not rendered by default.

GenomicRegion.hpp

Lines changed: 141 additions & 150 deletions
Large diffs are not rendered by default.

MappedRead.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,25 @@
2323
#include "MappedRead.hpp"
2424
#include "smithlab_utils.hpp"
2525

26-
#include <fstream>
2726
#include <algorithm>
27+
#include <fstream>
2828
#include <sstream>
2929
#include <string>
3030

31-
using std::string;
3231
using std::runtime_error;
32+
using std::string;
3333

3434
MappedRead::MappedRead(const string &line) {
3535
std::istringstream is;
36-
is.rdbuf()->pubsetbuf(const_cast<char*>(line.c_str()), line.size());
36+
is.rdbuf()->pubsetbuf(const_cast<char *>(line.c_str()), line.size());
3737

3838
string chrom, name, tmp;
3939
size_t start = 0ul, end = 0ul;
4040
char strand = '\0';
4141
double score;
4242
if (is >> chrom >> start >> tmp) {
4343
if (find_if(tmp.begin(), tmp.end(),
44-
[](char c) {return !std::isdigit(c);}) == tmp.end()) {
44+
[](char c) { return !std::isdigit(c); }) == tmp.end()) {
4545
end = std::stol(tmp);
4646
if (!(is >> name >> score >> strand >> seq))
4747
throw runtime_error("bad line in MappedRead file: " + line);
@@ -55,11 +55,11 @@ MappedRead::MappedRead(const string &line) {
5555
r = GenomicRegion(chrom, start, end, name, score, strand);
5656
is >> scr;
5757
}
58-
else throw runtime_error("bad line in MappedRead file: " + line);
58+
else
59+
throw runtime_error("bad line in MappedRead file: " + line);
5960
}
6061

61-
string
62-
MappedRead::tostring() const {
62+
string MappedRead::tostring() const {
6363
std::ostringstream oss;
6464
oss << r; // no chaining for the << of GenomicRegion
6565
oss << '\t' << seq;

MappedRead.hpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,15 @@ struct MappedRead {
3434
std::string tostring() const;
3535
};
3636

37-
template <class T> T&
38-
operator>>(T &the_stream, MappedRead &mr) {
37+
template <class T> T &operator>>(T &the_stream, MappedRead &mr) {
3938
std::string buffer;
4039
if (getline(the_stream, buffer)) {
4140
mr = MappedRead(buffer);
4241
}
4342
return the_stream;
4443
}
4544

46-
template <class T> T&
47-
operator<<(T &the_stream, const MappedRead &mr) {
45+
template <class T> T &operator<<(T &the_stream, const MappedRead &mr) {
4846
the_stream << mr.tostring();
4947
return the_stream;
5048
}

0 commit comments

Comments
 (0)