gdcmDirList.h

Go to the documentation of this file.
00001 /*=========================================================================
00002                                                                                 
00003   Program:   gdcm
00004   Module:    $RCSfile: gdcmDirList.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/08/22 16:14:04 $
00007   Version:   $Revision: 1.36 $
00008                                                                                 
00009   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
00010   l'Image). All rights reserved. See Doc/License.txt or
00011   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
00012                                                                                 
00013      This software is distributed WITHOUT ANY WARRANTY; without even
00014      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00015      PURPOSE.  See the above copyright notices for more information.
00016                                                                                 
00017 =========================================================================*/
00018 
00019 #ifndef _GDCMDIRLIST_H_
00020 #define _GDCMDIRLIST_H_
00021 
00022 #include "gdcmBase.h"
00023 #include "gdcmDicomDirSerie.h"
00024 
00025 #include <string>
00026 #include <vector>
00027 #include <iostream>
00028 
00029 namespace GDCM_NAME_SPACE
00030 {
00031 
00032 typedef std::vector<std::string> DirListType;
00033 
00034 //-----------------------------------------------------------------------------
00035 
00036 // NOTE: Due to a M$VC6 'feature' we cannot export a std::list in a dll, 
00037 // so GDCM_EXPORT keyword was removed for this class only
00038 //
00039 // We have to supply accessors GetSize(), GetFirst(), GetNext() 
00040 
00045 class GDCM_EXPORT DirList : public Base
00046 {
00047 public :
00048    DirList(std::string const &dirName, bool recursive);
00049    DirList(DicomDirSerie *s);   
00050    ~DirList();
00051 
00052    void Print(std::ostream &os = std::cout, std::string const &indent = "" );
00053 
00055    std::string const &GetDirName() const { return DirName; }
00056 
00058    DirListType const &GetFilenames() const { return Filenames; }
00059    
00061    int GetSize() const { return Filenames.size(); }  
00062 
00063    static bool IsDirectory(std::string const &dirName);
00064    
00065    std::string GetFirst();
00066    std::string GetNext();
00067    
00068 private :
00069    int Explore(std::string const &dirName, bool recursive=false);
00070    int Explore(DicomDirSerie *s);
00071    
00073    DirListType Filenames;
00075    std::string DirName;
00076    
00078    DirListType::iterator ItDirList;  
00079    
00080 };
00081 } // end namespace gdcm
00082 //-----------------------------------------------------------------------------
00083 #endif

Generated on Fri Aug 24 12:59:30 2007 for gdcm by  doxygen 1.4.6