|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #ifndef SAMPLE_HANDLER__SCAN_DIR_H
9 #define SAMPLE_HANDLER__SCAN_DIR_H
210 typedef std::vector<std::pair<boost::regex,std::string> >::const_iterator
SampleRenameIter;
226 const std::vector<std::string>& hierarchy)
const;
236 void addSampleFile (std::map<std::string,SamplePtr>& samples,
237 const std::vector<std::string>& hierarchy,
238 const std::string&
path)
const;
251 int relSampleDepth)
const;
the class used for scanning local directories and file servers for samples
boost::regex m_samplePattern
the value set by samplePattern, converted to a regular expression
ScanDir & sampleRename(const std::string &pattern, const std::string &name)
rename any sample matching pattern to name
ScanDir & directoryRegex(const std::string &val_directoryRegex)
the regular expression for directories to be visited
std::vector< std::pair< boost::regex, std::string > >::const_iterator SampleRenameIter
the list of entries from sampleRename
ScanDir & maxDepth(std::size_t val_maxDepth)
the maximum depth for files to make it into the sample
path
python interpreter configuration --------------------------------------—
boost::regex m_filePattern
the value set by filePattern, converted to a regular expression
boost::regex m_samplePostfix
the value set by samplePostfix, converted to a regular expression
std::size_t m_minDepth
the value set by minDepth
bool m_samplePostfixEmpty
whether samplePostfix has been set to the empty string
boost::regex m_directoryPattern
the value set by directoryPattern, converted to a regular expression
std::string findPathComponent(const std::vector< std::string > &hierarchy, int absSampleDepth, int relSampleDepth) const
find the path component at the given depth
std::string m_sampleName
the value set by sampleName
ScanDir & samplePattern(const std::string &val_samplePattern)
the pattern for samples to be accepted
ScanDir & directoryPattern(const std::string &val_directoryPattern)
the pattern for directories to be visited
ScanDir & samplePostfix(const std::string &val_samplePostfix)
the pattern for the postfix to be stripped from the sampleName
int m_relSampleDepth
if this is negative it is the depth at which we take the sample name, counting from the end
ScanDir & sampleDepth(int val_sampleDepth)
the index of the file hierarchy at which we gather the sample name.
an interface for listing directory contents, locally or on a file server
ScanDir & absSampleDepth(int val_absSampleDepth)
the index of the file hierarchy at which we gather the sample name.
ScanDir & extraNameComponent(int val_relSampleDepth)
attach an extra name component to the sample based on a second component of the path
std::vector< std::pair< boost::regex, std::string > > m_sampleRename
ScanDir & fileRegex(const std::string &val_fileRegex)
the regular expression for files to be accepted
int m_absSampleDepth
if m_relSampleDepth is not negative, it is the depth at which we take the sample name,...
const ScanDir & scan(SampleHandler &sh, const std::string &dir) const
scan the given directory and put the created samples into the sample handler
std::size_t m_maxDepth
the value set by maxDepth
const ScanDir & scanEOS(SampleHandler &sh, const std::string &eosDir) const
scan the given directory in EOS and put the created samples into the sample handler
ScanDir & sampleName(const std::string &val_sampleName)
a single sample name into which all found files should be placed.
ScanDir & filePattern(const std::string &val_filePattern)
the pattern for files to be accepted
A class that manages a list of Sample objects.
This module provides a lot of global definitions, forward declarations and includes that are used by ...
int m_extraNameComponent
the depth set with extraNameComponent, or 0 otherwise
void addSampleFile(std::map< std::string, SamplePtr > &samples, const std::vector< std::string > &hierarchy, const std::string &path) const
add the given file to the sample based on the hierarchy, creating the sample if necessary
ScanDir()
standard constructor
void recurse(std::map< std::string, SamplePtr > &samples, DiskList &list, const std::vector< std::string > &hierarchy) const
perform the recursive scanning of the directory tree
ScanDir & minDepth(std::size_t val_minDepth)
the minimum depth for files to make it into the sample