GDCM 3.2.1

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{
35
36 class GDCM_EXPORT FilenameGenerator
37{
38 public:
39 FilenameGenerator():Pattern(),Prefix(),Filenames() {}
40 ~FilenameGenerator() = default;
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 { gdcm_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
gdcm::FilenameGenerator::Generate
bool Generate()
Generate (return success)
gdcm::FilenameGenerator::~FilenameGenerator
~FilenameGenerator()=default
gdcm::FilenameGenerator::FilenamesType
std::vector< FilenameType > FilenamesType
Definition gdcmFilenameGenerator.h:43
gdcm::FilenameGenerator::SetPattern
void SetPattern(const char *pattern)
Set/Get pattern.
Definition gdcmFilenameGenerator.h:47
gdcm::FilenameGenerator::GetPattern
const char * GetPattern() const
Definition gdcmFilenameGenerator.h:48
gdcm::FilenameGenerator::SizeType
FilenamesType::size_type SizeType
Definition gdcmFilenameGenerator.h:44
gdcm::FilenameGenerator::SetPrefix
void SetPrefix(const char *prefix)
Set/Get prefix.
Definition gdcmFilenameGenerator.h:51
gdcm::FilenameGenerator::SetNumberOfFilenames
void SetNumberOfFilenames(SizeType nfiles)
Set/Get the number of filenames to generate.
gdcm::FilenameGenerator::GetPrefix
const char * GetPrefix() const
Definition gdcmFilenameGenerator.h:52
gdcm::FilenameGenerator::GetNumberOfFilenames
SizeType GetNumberOfFilenames() const
gdcm::FilenameGenerator::FilenameType
std::string FilenameType
Definition gdcmFilenameGenerator.h:42
gdcm::FilenameGenerator::GetFilenames
FilenamesType const & GetFilenames() const
Return all filenames.
Definition gdcmFilenameGenerator.h:65
gdcm::FilenameGenerator::GetFilename
const char * GetFilename(SizeType n) const
Get a particular filename (call after Generate)
gdcm::FilenameGenerator::FilenameGenerator
FilenameGenerator()
Definition gdcmFilenameGenerator.h:39
gdcm_assert
#define gdcm_assert(cond)
Definition gdcmException.h:104
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21