X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;ds=sidebyside;f=src%2FgdcmDirList.cxx;h=ca5c5fa1fc38b1ffae0ff13dfb870f56d4e5e087;hb=7ffa5a65da43145ef4cfe6a1bbd413842f7ee94e;hp=d3a8b46405b832b5afaaf45ec4414a5fd0ddbc7e;hpb=c9dd24ae7aab3c9f32af740ebfce6dfb47bd855f;p=gdcm.git diff --git a/src/gdcmDirList.cxx b/src/gdcmDirList.cxx index d3a8b464..ca5c5fa1 100644 --- a/src/gdcmDirList.cxx +++ b/src/gdcmDirList.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDirList.cxx,v $ Language: C++ - Date: $Date: 2004/10/10 00:42:54 $ - Version: $Revision: 1.22 $ + Date: $Date: 2004/12/12 13:32:23 $ + Version: $Revision: 1.29 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -22,7 +22,7 @@ #include #include -#if defined(_MSC_VER) || defined (__CYGWIN__) +#if defined(_MSC_VER) || defined(__BORLANDC__) #include #ifdef _MSC_VER #include @@ -34,25 +34,27 @@ #include #endif +namespace gdcm +{ // Constructor / Destructor /** - * \ingroup gdcmDirList + * \ingroup DirList * \brief Constructor * @param dirName root directory name * @param recursive whether we want to explore recursively or not */ -gdcmDirList::gdcmDirList(std::string dirName, bool recursive) +DirList::DirList(std::string const & dirName, bool recursive) { name = dirName; - gdcmUtil::NormalizePath(name); + Util::NormalizePath(name); Explore(name, recursive); } /** - * \ingroup gdcmDirList + * \ingroup DirList * \brief Destructor */ -gdcmDirList::~gdcmDirList() +DirList::~DirList() { } @@ -62,11 +64,11 @@ gdcmDirList::~gdcmDirList() //----------------------------------------------------------------------------- // Public /** - * \ingroup gdcmDirList + * \ingroup DirList * \brief Get the directory name * @return the directory name */ -std::string gdcmDirList::GetDirName() +std::string const & DirList::GetDirName() const { return name; } @@ -78,18 +80,17 @@ std::string gdcmDirList::GetDirName() // Private /** - * \ingroup gdcmDirList * \brief Explore a directory with possibility of recursion * return number of files read - * @param dirName directory to explore + * @param dirpath directory to explore * @param recursive whether we want recursion or not */ -int gdcmDirList::Explore(std::string dirName, bool recursive) +int DirList::Explore(std::string const & dirpath, bool recursive) { int numberOfFiles = 0; std::string fileName; - gdcmUtil::NormalizePath(dirName); -#if defined(_MSC_VER) || (__CYGWIN__) + std::string dirName = Util::NormalizePath(dirpath); +#if defined(_MSC_VER) || defined(__BORLANDC__) WIN32_FIND_DATA fileData; HANDLE hFile=FindFirstFile((dirName+"*").c_str(),&fileData); int found = true; @@ -158,5 +159,6 @@ int gdcmDirList::Explore(std::string dirName, bool recursive) return numberOfFiles; } +} // end namespace gdcm //-----------------------------------------------------------------------------