gdcmFilenameGenerator.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMFILENAMEGENERATOR_H
#define GDCMFILENAMEGENERATOR_H
#include "gdcmTypes.h"
#include <string>
#include <vector>
namespace gdcm
{
class GDCM_EXPORT FilenameGenerator
{
public:
FilenameGenerator():Pattern(),Prefix(),Filenames() {}
~FilenameGenerator() = default;
// FIXME: already defines in gdcm::Directory
typedef std::string FilenameType;
typedef std::vector<FilenameType> FilenamesType;
typedef FilenamesType::size_type SizeType;
void SetPattern(const char *pattern) { Pattern = pattern; }
const char *GetPattern() const { return Pattern.c_str(); }
void SetPrefix(const char *prefix) { Prefix = prefix; }
const char *GetPrefix() const { return Prefix.c_str(); }
bool Generate();
void SetNumberOfFilenames(SizeType nfiles);
SizeType GetNumberOfFilenames() const;
const char * GetFilename(SizeType n) const;
FilenamesType const & GetFilenames() const { assert( !Pattern.empty() ); return Filenames; }
private:
FilenameType Pattern;
FilenameType Prefix;
FilenamesType Filenames;
};
} // end namespace gdcm
#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
gdcmTypes.h
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21