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

Method Open

src/utils/bedFilePE/bedFilePE.cpp:28–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

isGzipFileFunction · 0.85
c_strMethod · 0.45

Tested by

no test coverage detected