From 3f8a06320999ce0f5cbe5c71554c7beb68d355ba Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Thu, 23 Mar 2017 11:37:35 +0100 Subject: [PATCH] Rename get_dir_size() to get_dir_count() --- src/filefunc.cpp | 4 ++-- src/filefunc.hxx | 2 +- test/test_filefunc.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filefunc.cpp b/src/filefunc.cpp index cf5601a..e1e4882 100644 --- a/src/filefunc.cpp +++ b/src/filefunc.cpp @@ -308,7 +308,7 @@ bool get_dir( std::vector< std::string >& result, bool include_dot_names ) { - // code copied for get_dir_size; keep in sync + // code copied to get_dir_count; keep in sync DIR* dir = ::opendir( path.c_str()); if (!dir) { @@ -349,7 +349,7 @@ std::vector< std::string > get_dir(const std::string& path, bool include_dot_nam * @param include_dot_names determines if dot-files should be included in the count. * @return the number of entries in the directory; return -1 in case of error */ -int get_dir_size(const std::string& path, bool include_dot_names) +int get_dir_count(const std::string& path, bool include_dot_names) { // code is a simplified copy of get_dir, above. Keep in sync int result = 0; diff --git a/src/filefunc.hxx b/src/filefunc.hxx index b9f2d44..6051707 100644 --- a/src/filefunc.hxx +++ b/src/filefunc.hxx @@ -162,7 +162,7 @@ time_t file_mtime(const std::string& path); bool get_dir(const std::string& path, std::vector< std::string >& result, bool include_dot_names= false ); std::vector< std::string > get_dir(const std::string& path, bool include_dot_names= false ); -int get_dir_size(const std::string& path, bool include_dot_names= false ); +int get_dir_count(const std::string& path, bool include_dot_names= false ); bool unlink(const std::string& path); diff --git a/test/test_filefunc.cpp b/test/test_filefunc.cpp index 0deb521..bf4e7e6 100644 --- a/test/test_filefunc.cpp +++ b/test/test_filefunc.cpp @@ -156,7 +156,7 @@ BOOST_AUTO_TEST_CASE(DirTest1) BOOST_CHECK_EQUAL( true, res ); BOOST_CHECK( ! names.empty() ); - BOOST_CHECK_EQUAL(I2n::get_dir_size(test_dir), names.size()); + BOOST_CHECK_EQUAL(I2n::get_dir_count(test_dir), names.size()); BOOST_MESSAGE("Looking for " << basename(__FILE__) << " in " << test_dir); StringVector::iterator it = std::find( names.begin(), names.end(), basename(__FILE__)); @@ -167,7 +167,7 @@ BOOST_AUTO_TEST_CASE(DirTest1) names= get_dir(test_dir,true); BOOST_CHECK( ! names.empty() ); - BOOST_CHECK_EQUAL(I2n::get_dir_size(test_dir, true), names.size()); + BOOST_CHECK_EQUAL(I2n::get_dir_count(test_dir, true), names.size()); for (it= names.begin(); it!=names.end(); ++it) { -- 1.7.1