From 495666742baf665e78c8d1d5a38bea6f0e8ab837 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 24 Feb 2005 14:47:45 -0500 Subject: [PATCH] ENH: Added ComparePath method. --- Source/kwsys/SystemTools.cxx | 10 ++++++++++ Source/kwsys/SystemTools.hxx.in | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 9481d024f..58bdf075b 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1833,6 +1833,16 @@ SystemTools::JoinPath(const kwsys_stl::vector& components) return result; } +//---------------------------------------------------------------------------- +bool SystemTools::ComparePath(const char* c1, const char* c2) +{ +#if defined(_WIN32) || defined(__APPLE__) + return SystemTools::Strucmp(c1, c2) == 0; +#else + return strcmp(c1, c2) == 0; +#endif +} + bool SystemTools::Split(const char* str, kwsys_stl::vector& lines) { kwsys_stl::string data(str); diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index ab702d216..a9ebfe780 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -273,6 +273,11 @@ public: static kwsys_stl::string JoinPath(const kwsys_stl::vector& components); + /** + * Compare a path or components of a path. + */ + static bool ComparePath(const char* c1, const char* c2); + ///! return path of a full filename (no trailing slashes). static kwsys_stl::string GetFilenamePath(const kwsys_stl::string&);