GDCM  2.2.0
gdcmFilenameGenerator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMFILENAMEGENERATOR_H
00015 #define GDCMFILENAMEGENERATOR_H
00016 
00017 #include "gdcmTypes.h"
00018 #include <string>
00019 #include <vector>
00020 
00021 
00022 namespace gdcm
00023 {
00036 class GDCM_EXPORT FilenameGenerator
00037 {
00038 public:
00039   FilenameGenerator():Pattern(),Prefix(),Filenames() {}
00040   ~FilenameGenerator() {}
00041   // FIXME: already defines in gdcm::Directory
00042   typedef std::string FilenameType;
00043   typedef std::vector<FilenameType> FilenamesType;
00044   typedef FilenamesType::size_type  SizeType;
00045 
00047   void SetPattern(const char *pattern) { Pattern = pattern; }
00048   const char *GetPattern() const { return Pattern.c_str(); }
00049 
00051   void SetPrefix(const char *prefix) { Prefix = prefix; }
00052   const char *GetPrefix() const { return Prefix.c_str(); }
00053 
00055   bool Generate();
00056 
00058   void SetNumberOfFilenames(SizeType nfiles);
00059   SizeType GetNumberOfFilenames() const;
00060 
00062   const char * GetFilename(SizeType n) const;
00063 
00065   FilenamesType const & GetFilenames() const { assert( !Pattern.empty() ); return Filenames; }
00066 
00067 private:
00068   FilenameType Pattern;
00069   FilenameType Prefix;
00070   FilenamesType Filenames;
00071 };
00072 
00073 } // end namespace gdcm
00074 
00075 #endif //GDCMFILENAMEGENERATOR_H

Generated on Sun Jun 3 2012 14:19:42 for GDCM by doxygen 1.8.0
SourceForge.net Logo