TestUtil.cxx
TestDicomString.cxx
TestDict.cxx
+ TestDirList.cxx
)
# add tests that require data
--- /dev/null
+/*=========================================================================
+
+ Program: gdcm
+ Module: $RCSfile: TestDirList.cxx,v $
+ Language: C++
+ Date: $Date: 2005/01/14 21:52:05 $
+ Version: $Revision: 1.1 $
+
+ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+ l'Image). All rights reserved. See Doc/License.txt or
+ http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#include "gdcmDirList.h"
+
+int TestDirList(int , char* [])
+{
+ std::string path = GDCM_DATA_ROOT;
+ std::cerr << path << std::endl;
+
+ gdcm::DirList list(path);
+ list.Print();
+
+ return 0;
+}
Program: gdcm
Module: $RCSfile: gdcmDirList.cxx,v $
Language: C++
- Date: $Date: 2005/01/12 22:09:55 $
- Version: $Revision: 1.32 $
+ Date: $Date: 2005/01/14 21:52:06 $
+ Version: $Revision: 1.33 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmDirList.h"
#include "gdcmUtil.h"
-#include <iostream>
+#include <iterator>
#ifdef _MSC_VER
#include <windows.h>
DirList::DirList(std::string const &dirName, bool recursive)
{
DirName = dirName;
- Util::NormalizePath(DirName);
- Explore(DirName, recursive);
+ Explore(dirName, recursive);
}
/**
return DirName;
}
+void DirList::Print(std::ostream &os)
+{
+ copy(begin(), end(), std::ostream_iterator<std::string>(os, "\n"));
+}
+
//-----------------------------------------------------------------------------
// Protected
Program: gdcm
Module: $RCSfile: gdcmDirList.h,v $
Language: C++
- Date: $Date: 2005/01/12 22:09:55 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2005/01/14 21:52:06 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmCommon.h"
#include <string>
-#include <list>
+#include <vector>
+#include <iostream>
namespace gdcm
{
// NOTE: Due to a VC6 'feature' we can not export a std::list in a dll,
// so GDCM_EXPORT keyword was removed for this class only
-class DirList: public std::list<std::string>
+class DirList : public std::vector<std::string>
{
public :
DirList(std::string const &dirName, bool recursive=false);
std::string const &GetDirName() const;
+ void Print(std::ostream &os = std::cout);
+
/// Character '\'
static const char SEPARATOR_X;
/// Character '/'