MCPcopy Create free account
hub / github.com/arq5x/bedtools2 / Open

Method Open

src/utils/bedGraphFile/bedGraphFile.cpp:29–52  ·  view source on GitHub ↗

Open the BEDGRAPH file

Source from the content-addressed store, hash-verified

27
28// Open the BEDGRAPH file
29void BedGraphFile::Open() {
30 if (bedGraphFile == "stdin" || bedGraphFile == "-") {
31 _bedGraphStream = &cin;
32 }
33 else {
34 _bedGraphStream = new ifstream(bedGraphFile.c_str(), ios::in);
35
36 if (isGzipFile(_bedGraphStream) == true) {
37 delete _bedGraphStream;
38 _bedGraphStream = new igzstream(bedGraphFile.c_str(), ios::in);
39 }
40 // can we open the file?
41 if ( _bedGraphStream->fail() ) {
42 cerr << "Error: The requested file ("
43 << bedGraphFile
44 << ") "
45 << "could not be opened. "
46 << "Error message: ("
47 << strerror(errno)
48 << "). Exiting!" << endl;
49 exit (1);
50 }
51 }
52}
53
54
55// Close the BEDGRAPH file

Callers

nothing calls this directly

Calls 2

isGzipFileFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected