From 05379269d3e88d596b0d3c331cc4d5548f2d912f Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Fri, 22 May 2015 12:39:25 -0400 Subject: read gz files --- extractor/CMakeLists.txt | 2 +- extractor/alignment.cc | 5 ++++- extractor/data_array.cc | 8 ++++++-- 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 #include +#include "filelib.h" + #include 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 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 #include +#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 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 lines; string line, delimiter = "|||"; while (getline(infile, line)) { -- cgit v1.2.3