From 6f56d6e9a7d4364a3d48eb7616899eeb6917b9bd Mon Sep 17 00:00:00 2001 From: Brad King <brad.king@kitware.com> Date: Tue, 21 Apr 2009 11:36:59 -0400 Subject: [PATCH] ENH: Remove obscure method from KWSys SystemTools This removes SystemTools::FileExistsInParentDirectories from KWSys since it is a special-purpose method that is not generally useful. --- SystemTools.cxx | 23 ----------------------- SystemTools.hxx.in | 8 -------- kwsysDateStamp.cmake | 2 +- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/SystemTools.cxx b/SystemTools.cxx index c09001b..5ce335a 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -4000,29 +4000,6 @@ bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir) return false; } -kwsys_stl::string SystemTools::FileExistsInParentDirectories(const char* fname, - const char* directory, const char* toplevel) -{ - kwsys_stl::string file = fname; - SystemTools::ConvertToUnixSlashes(file); - kwsys_stl::string dir = directory; - SystemTools::ConvertToUnixSlashes(dir); - while ( !dir.empty() ) - { - kwsys_stl::string path = dir + "/" + file; - if ( SystemTools::FileExists(path.c_str()) ) - { - return path; - } - if ( dir.size() < strlen(toplevel) ) - { - break; - } - dir = SystemTools::GetParentDirectory(dir.c_str()); - } - return ""; -} - void SystemTools::Delay(unsigned int msec) { #ifdef _WIN32 diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index 585e488..94586b0 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -659,14 +659,6 @@ public: const char *dir, kwsys_stl::string& filename_found, int try_filename_dirs = 0); - - /** - * Check if the given file exists in one of the parent directory of the - * given file or directory and if it does, return the name of the file. - * Toplevel specifies the top-most directory to where it will look. - */ - static kwsys_stl::string FileExistsInParentDirectories(const char* fname, - const char* directory, const char* toplevel); /** compute the relative path from local to remote. local must be a directory. remote can be a file or a directory. diff --git a/kwsysDateStamp.cmake b/kwsysDateStamp.cmake index 65f81e6..86b891b 100644 --- a/kwsysDateStamp.cmake +++ b/kwsysDateStamp.cmake @@ -7,4 +7,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2009) SET(KWSYS_DATE_STAMP_MONTH 04) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 20) +SET(KWSYS_DATE_STAMP_DAY 21) -- GitLab