summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2015-05-22 12:39:25 -0400
committerChris Dyer <redpony@gmail.com>2015-05-22 12:39:25 -0400
commit05379269d3e88d596b0d3c331cc4d5548f2d912f (patch)
tree9c9a743884796e466ee244c63fdd66a4f459b81a
parentcf61f8bc83ef280292a141ac9f8148eaf28596cc (diff)
read gz files
-rw-r--r--extractor/CMakeLists.txt2
-rw-r--r--extractor/alignment.cc5
-rw-r--r--extractor/data_array.cc8
3 files changed, 11 insertions, 4 deletions
diff --git a/extractor/CMakeLists.txt b/extractor/CMakeLists.txt
index 93a524cc..c8998e91 100644
--- a/extractor/CMakeLists.txt
+++ b/extractor/CMakeLists.txt
@@ -56,7 +56,7 @@ endif(GTEST_FOUND)
set(sacompile_SRCS sacompile.cc)
add_executable(sacompile ${sacompile_SRCS})
-target_link_libraries(sacompile extractor ${Boost_LIBRARIES} z)
+target_link_libraries(sacompile extractor utils ${Boost_LIBRARIES} z)
set(run_extractor_SRCS run_extractor.cc)
add_executable(run_extractor ${run_extractor_SRCS})
diff --git a/extractor/alignment.cc b/extractor/alignment.cc
index 4a7a14f4..3f9bc630 100644
--- a/extractor/alignment.cc
+++ b/extractor/alignment.cc
@@ -7,6 +7,8 @@
#include <unistd.h>
#include <vector>
+#include "filelib.h"
+
#include <boost/algorithm/string.hpp>
using namespace std;
@@ -14,7 +16,8 @@ using namespace std;
namespace extractor {
Alignment::Alignment(const string& filename) {
- ifstream infile(filename.c_str());
+ ReadFile rf(filename);
+ istream& infile = *rf.stream();
string line;
while (getline(infile, line)) {
vector<string> items;
diff --git a/extractor/data_array.cc b/extractor/data_array.cc
index 9612aa8a..130cd99b 100644
--- a/extractor/data_array.cc
+++ b/extractor/data_array.cc
@@ -5,6 +5,8 @@
#include <sstream>
#include <string>
+#include "filelib.h"
+
using namespace std;
namespace extractor {
@@ -20,7 +22,8 @@ DataArray::DataArray() {
DataArray::DataArray(const string& filename) {
InitializeDataArray();
- ifstream infile(filename.c_str());
+ ReadFile rf(filename);
+ istream& infile = *rf.stream();
vector<string> lines;
string line;
while (getline(infile, line)) {
@@ -31,7 +34,8 @@ DataArray::DataArray(const string& filename) {
DataArray::DataArray(const string& filename, const Side& side) {
InitializeDataArray();
- ifstream infile(filename.c_str());
+ ReadFile rf(filename);
+ istream& infile = *rf.stream();
vector<string> lines;
string line, delimiter = "|||";
while (getline(infile, line)) {