lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
psalg::DirFileIterator Class Reference

Iterates over the entries of a directory whose names contain a pattern; next() returns dirname + "/" + name. More...

#include <DirFileIterator.hh>

Inherited by detector::EventIteratorSimulator.

Public Member Functions

 DirFileIterator (const char *dirname="/reg/neh/home/dubrovin/LCLS/con-detector/work/", const char *pattern=0)
 Open dirname with opendir() (a WARNING is logged if that fails) and keep pattern (null means every entry).
 
 ~DirFileIterator ()
 Close the directory with closedir(), without checking that it was opened.
 
const std::string & next ()
 Return the next entry ("." and ".." included) whose name contains the pattern, as dirname + "/" + name, or an empty string when none is left.
 

Detailed Description

Iterates over the entries of a directory whose names contain a pattern; next() returns dirname + "/" + name.

Constructor & Destructor Documentation

◆ DirFileIterator()

psalg::DirFileIterator::DirFileIterator ( const char *  dirname = "/reg/neh/home/dubrovin/LCLS/con-detector/work/",
const char *  pattern = 0 
)

Open dirname with opendir() (a WARNING is logged if that fails) and keep pattern (null means every entry).

Only the pointers are kept, and the default dirname is a hard-coded /reg/neh/home/dubrovin path.

◆ ~DirFileIterator()

psalg::DirFileIterator::~DirFileIterator ( )

Close the directory with closedir(), without checking that it was opened.

Member Function Documentation

◆ next()

const std::string & psalg::DirFileIterator::next ( )

Return the next entry ("." and ".." included) whose name contains the pattern, as dirname + "/" + name, or an empty string when none is left.

The returned reference refers to a member string overwritten by the next call; a directory that failed to open is not checked.


The documentation for this class was generated from the following file: