Skip to content
Snippets Groups Projects
Commit 88ac8da9 authored by nkindlon's avatar nkindlon
Browse files

added fifo handling

parent 8085e45a
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
#include "gzstream.h" #include "gzstream.h"
#include "CompressionTools.h" #include "CompressionTools.h"
const char *InputStreamMgr::FIFO_STRING_LITERAL = "/dev/fd";
InputStreamMgr::InputStreamMgr(const QuickString &filename, bool buildScanBuffer) InputStreamMgr::InputStreamMgr(const QuickString &filename, bool buildScanBuffer)
: :
_filename(filename), _filename(filename),
...@@ -55,6 +57,9 @@ bool InputStreamMgr::init() ...@@ -55,6 +57,9 @@ bool InputStreamMgr::init()
} }
_pushBackStreamBuf = new PushBackStreamBuf(cin.rdbuf()); _pushBackStreamBuf = new PushBackStreamBuf(cin.rdbuf());
} else { } else {
if (strncmp(_filename.c_str(), FIFO_STRING_LITERAL, strlen(FIFO_STRING_LITERAL)) == 0) {
_isStdin = true;
}
_inputFileStream = new ifstream(_filename.c_str()); _inputFileStream = new ifstream(_filename.c_str());
if (_inputFileStream->fail()) { if (_inputFileStream->fail()) {
cerr << "Error: Unable to open file " << _filename << ". Exiting." << endl; cerr << "Error: Unable to open file " << _filename << ". Exiting." << endl;
......
...@@ -52,6 +52,8 @@ private: ...@@ -52,6 +52,8 @@ private:
static const int SCAN_BUFFER_SIZE = 4096; // 4 K buffer static const int SCAN_BUFFER_SIZE = 4096; // 4 K buffer
static const int MIN_SCAN_BUFFER_SIZE = 2048; static const int MIN_SCAN_BUFFER_SIZE = 2048;
int _numBytesInBuffer; //this will hold the length of the buffer after the scan. int _numBytesInBuffer; //this will hold the length of the buffer after the scan.
static const char *FIFO_STRING_LITERAL;
bool bamDetected(int numChars, int currChar); bool bamDetected(int numChars, int currChar);
void decompressBuffer(); void decompressBuffer();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment