diff --git a/src/main.cpp b/src/main.cpp index 7884ff5..6fc3484 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -10,11 +11,13 @@ // std::string reversedComplement(std::string DNAsequence); -#define OPEN_IFS_AND_CHECK(file_path,value_name)std::ifstream value_name(file_path);if(value_name.is_open()==false){std::stringstream ss;ss<<"cannot open input file stream : "< DNAsequence) { using namespace std; @@ -50,7 +53,7 @@ int main() // std::ios_base::sync_with_stdio(false); //加了没效果 using namespace std; - char buf[50000]; + std::array buf; int lines = 0; filesystem::path input_path("filteredReads.txt"),output_path("reversedSequence.txt"); @@ -59,19 +62,16 @@ int main() // ofstream output_file_stream(output_path); OPEN_IFS_AND_CHECK(input_path, input_file_stream) OPEN_OFS_AND_CHECK(output_path, output_file_stream) - - zt::check_fstream_isopen(input_file_stream, output_file_stream); - - zt::print("open file ok!\n"); string l = ""; - while (input_file_stream.getline(buf,50000,'\n')) + while (input_file_stream.getline(buf.data(),50000,'\n')) { int m = lines%2; if (m == 1) - output_file_stream << reverseComplement(buf) << endl; - else + reverseComplement(buf); + // output_file_stream << reverseComplement(buf) << endl; + // else output_file_stream << buf << endl; lines++; }