Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2006/01/10 15:54:03 $
- Version: $Revision: 1.58 $
+ Date: $Date: 2006/11/15 15:53:08 $
+ Version: $Revision: 1.60 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
else
{
- const char *str = strerror(errno);
- gdcmStaticErrorMacro( str );
+ gdcmStaticErrorMacro( strerror(errno) );
return false;
}
}
+/**
+ * \brief Get the first entry while visiting Filenames
+ * \return The first if found, otherwhise ""
+ */
+std::string DirList::GetFirst()
+{
+ ItDirList = Filenames.begin();
+ if (ItDirList != Filenames.end())
+ return *ItDirList;
+ return "";
+}
+
+/**
+ * \brief Get the next entry while visiting Filenames
+ * \return The next if found, otherwhise ""
+ */
+std::string DirList::GetNext()
+{
+ gdcmAssertMacro (ItDirList != Filenames.end())
+ {
+ ++ItDirList;
+ if (ItDirList != Filenames.end())
+ return *ItDirList;
+ }
+ return "";
+}
+
//-----------------------------------------------------------------------------
// Protected
fileName = dirName + d->d_name;
if( stat(fileName.c_str(), &buf) != 0 )
{
- const char *str = strerror(errno);
- gdcmErrorMacro( str );
+ gdcmErrorMacro( strerror(errno) );
}
if ( S_ISREG(buf.st_mode) ) //is it a regular file?
{
}
if( closedir(dir) != 0 )
{
- const char *str = strerror(errno);
- gdcmErrorMacro( str );
+ gdcmErrorMacro( strerror(errno) );
}
#endif