From 70e6fe3f9b4db9a18bf5cc063893a1b838be17be Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 6 Mar 2006 10:12:02 -0500 Subject: ENH: Redo implementation of itkDirectory to use kwsys (avoid duplicating code). --- Source/kwsys/Directory.cxx | 10 ++++++++-- Source/kwsys/Directory.hxx.in | 11 ++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Source/kwsys/Directory.cxx b/Source/kwsys/Directory.cxx index fefdab8..727e61a 100644 --- a/Source/kwsys/Directory.cxx +++ b/Source/kwsys/Directory.cxx @@ -55,13 +55,13 @@ Directory::~Directory() } //---------------------------------------------------------------------------- -unsigned long Directory::GetNumberOfFiles() +unsigned long Directory::GetNumberOfFiles() const { return static_cast(this->Internal->Files.size()); } //---------------------------------------------------------------------------- -const char* Directory::GetFile(unsigned long dindex) +const char* Directory::GetFile(unsigned long dindex) const { if ( dindex >= this->Internal->Files.size() ) { @@ -70,6 +70,12 @@ const char* Directory::GetFile(unsigned long dindex) return this->Internal->Files[dindex].c_str(); } +//---------------------------------------------------------------------------- +const char* Directory::GetPath() const +{ + return this->Internal->Path.c_str(); +} + } // namespace KWSYS_NAMESPACE // First microsoft compilers diff --git a/Source/kwsys/Directory.hxx.in b/Source/kwsys/Directory.hxx.in index afa6a45..0a927a4 100644 --- a/Source/kwsys/Directory.hxx.in +++ b/Source/kwsys/Directory.hxx.in @@ -45,13 +45,18 @@ public: /** * Return the number of files in the current directory. */ - unsigned long GetNumberOfFiles(); + unsigned long GetNumberOfFiles() const; /** * Return the file at the given index, the indexing is 0 based */ - const char* GetFile(unsigned long); - + const char* GetFile(unsigned long) const; + + /** + * Return the path to Open'ed directory + */ + const char* GetPath() const; + private: // Private implementation details. DirectoryInternals* Internal; -- cgit v0.12