Skip to content

Commit 1d4914b

Browse files
Moving the function has_gz_ext from zlib_wrapper.hpp to smithlab_os.hpp
1 parent 736498c commit 1d4914b

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

smithlab_os.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,3 +556,10 @@ is_valid_output_file(const string &filename) {
556556
return (access(dir_part.c_str(), F_OK | W_OK) == 0);
557557
}
558558
}
559+
560+
bool
561+
has_gz_ext(const string &filename) {
562+
const string ext(".gz");
563+
return filename.size() >= ext.size()
564+
&& filename.compare(filename.size() - ext.size(), ext.size(), ext) == 0;
565+
}

smithlab_os.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,4 +114,7 @@ read_dir(const std::string& dirname, std::vector<std::string> &filenames);
114114
bool
115115
is_valid_output_file(const std::string &filename);
116116

117+
118+
bool has_gz_ext(const std::string &filename);
119+
117120
#endif

zlib_wrapper.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,3 @@ operator<<(ogzfstream &out, const char c) {
5454
gzputc(out.fileobj, c);
5555
return out;
5656
}
57-
58-
bool
59-
has_gz_ext(const string &filename) {
60-
const string ext(".gz");
61-
return filename.size() >= ext.size()
62-
&& filename.compare(filename.size() - ext.size(), ext.size(), ext) == 0;
63-
}

zlib_wrapper.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,4 @@ operator<<(ogzfstream &out, const std::string &line);
6464
ogzfstream&
6565
operator<<(ogzfstream &out, const char c);
6666

67-
bool has_gz_ext(const std::string &filename);
68-
6967
#endif

0 commit comments

Comments
 (0)