Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef GDCMFILENAMEGENERATOR_H
00016 #define GDCMFILENAMEGENERATOR_H
00017
00018 #include "gdcmTypes.h"
00019 #include <string>
00020 #include <vector>
00021
00022
00023 namespace gdcm
00024 {
00037 class GDCM_EXPORT FilenameGenerator
00038 {
00039 public:
00040 FilenameGenerator():Pattern(),Prefix(),Filenames() {}
00041 ~FilenameGenerator() {}
00042
00043 typedef std::string FilenameType;
00044 typedef std::vector<FilenameType> FilenamesType;
00045 typedef FilenamesType::size_type SizeType;
00046
00048 void SetPattern(const char *pattern) { Pattern = pattern; }
00049 const char *GetPattern() const { return Pattern.c_str(); }
00050
00052 void SetPrefix(const char *prefix) { Prefix = prefix; }
00053 const char *GetPrefix() const { return Prefix.c_str(); }
00054
00056 bool Generate();
00057
00059 void SetNumberOfFilenames(SizeType nfiles);
00060 SizeType GetNumberOfFilenames() const;
00061
00063 const char * GetFilename(SizeType n) const;
00064
00066 FilenamesType const & GetFilenames() const { assert( !Pattern.empty() ); return Filenames; }
00067
00068 private:
00069 FilenameType Pattern;
00070 FilenameType Prefix;
00071 FilenamesType Filenames;
00072 };
00073
00074 }
00075
00076 #endif //GDCMFILENAMEGENERATOR_H