]> Creatis software - gdcm.git/commitdiff
BUG: Could not use DirList from a dll on windows since the symbol was not exported...
authormalaterre <malaterre>
Fri, 14 Jan 2005 22:20:11 +0000 (22:20 +0000)
committermalaterre <malaterre>
Fri, 14 Jan 2005 22:20:11 +0000 (22:20 +0000)
src/gdcmDicomDir.cxx
src/gdcmDirList.cxx
src/gdcmDirList.h
src/gdcmSerieHeader.cxx

index cbaa1367c19faa72266857ca40c538b3fa3486f0..541273ab337ed12d842bfb82bec4633e43c5b258 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDicomDir.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/13 12:19:58 $
-  Version:   $Revision: 1.100 $
+  Date:      $Date: 2005/01/14 22:20:11 $
+  Version:   $Revision: 1.101 $
   
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -414,12 +414,14 @@ bool DicomDir::WriteDicomDir(std::string const &fileName)
 void DicomDir::CreateDicomDirChainedList(std::string const & path)
 {
    CallStartMethod();
-   DirList fileList(path,1); // gets recursively the file list
+   DirList dirList(path,1); // gets recursively the file list
    unsigned int count = 0;
    VectDocument list;
    Header *header;
 
-   for( DirList::iterator it  = fileList.begin();
+   DirListType fileList = dirList.GetFilenames();
+
+   for( DirListType::iterator it  = fileList.begin();
                               it != fileList.end();
                               ++it )
    {
@@ -452,7 +454,7 @@ void DicomDir::CreateDicomDirChainedList(std::string const & path)
    // sorts Patient/Study/Serie/
    std::sort(list.begin(), list.end(), DicomDir::HeaderLessThan );
    
-   std::string tmp = fileList.GetDirName();      
+   std::string tmp = dirList.GetDirName();      
    //for each Header of the chained list, add/update the Patient/Study/Serie/Image info
    SetElements(tmp, list);
    CallEndMethod();
index 65c6b358355bff5f991ffdcc131fc616983dd96f..083dfa04be1c0b7cde5e569dd5c605d5e7ce6920 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 21:52:06 $
-  Version:   $Revision: 1.33 $
+  Date:      $Date: 2005/01/14 22:20:11 $
+  Version:   $Revision: 1.34 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -53,24 +53,17 @@ DirList::~DirList()
 {
 }
 
-//-----------------------------------------------------------------------------
-// Print
-
 //-----------------------------------------------------------------------------
 // Public
+
 /**
  * \ingroup DirList
- * \brief   Get the directory name
- * @return the directory name 
+ * \brief   Print method
  */
-std::string const &DirList::GetDirName() const
-{
-   return DirName;
-}
-
 void DirList::Print(std::ostream &os)
 {
-   copy(begin(), end(), std::ostream_iterator<std::string>(os, "\n"));
+   std::copy(Filenames.begin(), Filenames.end(), 
+             std::ostream_iterator<std::string>(os, "\n"));
 }
 
 //-----------------------------------------------------------------------------
@@ -138,7 +131,7 @@ int DirList::Explore(std::string const &dirpath, bool recursive)
       stat(fileName.c_str(), &buf); //really discard output ?
       if( S_ISREG(buf.st_mode) )    //is it a regular file?
       {
-         push_back( fileName );
+         Filenames.push_back( fileName );
          numberOfFiles++;
       }
       else if( S_ISDIR(buf.st_mode) ) //directory?
index 8361a808811906c55f64ad6075228e88d06b64f3..7e79044be68181e458b732a214d511a1f2b85d37 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmDirList.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 21:52:06 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2005/01/14 22:20:11 $
+  Version:   $Revision: 1.18 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -37,26 +37,28 @@ 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::vector<std::string>
+typedef std::vector<std::string> DirListType;
+
+class GDCM_EXPORT DirList
 {
 public :
    DirList(std::string const &dirName, bool recursive=false);
-   virtual ~DirList();
+   ~DirList();
 
-   std::string const &GetDirName() const;
+   /// Return the name of the directory
+   std::string const &GetDirName() const { return DirName; }
 
-   void Print(std::ostream &os = std::cout);
+   /// Return the file names
+   DirListType const &GetFilenames() const { return Filenames; };
 
-   /// Character '\' 
-   static const char SEPARATOR_X;
-   /// Character '/'  
-   static const char SEPARATOR_WIN;
-   /// depending on the O.S.
-   static const std::string SEPARATOR;
+   /// Print all element of the DirList
+   void Print(std::ostream &os = std::cout);
 
 private :
    int Explore(std::string const &dirName, bool recursive=false);
 
+   DirListType Filenames;
+
    /// name of the root directory to explore
    std::string DirName;
 };
index 64fffb411915cf5e8629d08751ff71e5783187a1..e1347e2635cc42d6901426d0e24af4c6e4165f03 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmSerieHeader.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/14 21:34:53 $
-  Version:   $Revision: 1.8 $
+  Date:      $Date: 2005/01/14 22:20:11 $
+  Version:   $Revision: 1.9 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -97,9 +97,10 @@ void SerieHeader::AddFileName(std::string const &filename)
 void SerieHeader::SetDirectory(std::string const &dir)
 {
    CurrentSerieUID = ""; //Reset previous Serie Instance UID
-   DirList filenames_list(dir);  //OS specific
+   DirList dirList(dir);  //OS specific
   
-   for( DirList::const_iterator it = filenames_list.begin(); 
+   DirListType filenames_list = dirList.GetFilenames();
+   for( DirListType::const_iterator it = filenames_list.begin(); 
         it != filenames_list.end(); ++it)
    {
       AddFileName( *it );