GDCM  2.2.0
gdcmFilenameGenerator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: GDCM (Grassroots DICOM). A DICOM library
4 
5  Copyright (c) 2006-2011 Mathieu Malaterre
6  All rights reserved.
7  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 #ifndef GDCMFILENAMEGENERATOR_H
15 #define GDCMFILENAMEGENERATOR_H
16 
17 #include "gdcmTypes.h"
18 #include <string>
19 #include <vector>
20 
21 
22 namespace gdcm
23 {
37 {
38 public:
39  FilenameGenerator():Pattern(),Prefix(),Filenames() {}
41  // FIXME: already defines in gdcm::Directory
42  typedef std::string FilenameType;
43  typedef std::vector<FilenameType> FilenamesType;
44  typedef FilenamesType::size_type SizeType;
45 
47  void SetPattern(const char *pattern) { Pattern = pattern; }
48  const char *GetPattern() const { return Pattern.c_str(); }
49 
51  void SetPrefix(const char *prefix) { Prefix = prefix; }
52  const char *GetPrefix() const { return Prefix.c_str(); }
53 
55  bool Generate();
56 
58  void SetNumberOfFilenames(SizeType nfiles);
59  SizeType GetNumberOfFilenames() const;
60 
62  const char * GetFilename(SizeType n) const;
63 
65  FilenamesType const & GetFilenames() const { assert( !Pattern.empty() ); return Filenames; }
66 
67 private:
68  FilenameType Pattern;
69  FilenameType Prefix;
70  FilenamesType Filenames;
71 };
72 
73 } // end namespace gdcm
74 
75 #endif //GDCMFILENAMEGENERATOR_H

Generated on Wed Jun 13 2012 20:40:37 for GDCM by doxygen 1.8.1
SourceForge.net Logo