Mantid
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
Mantid::Kernel::Glob Class Reference

This Glob class uses the glob() method of Poco::Glob class to make it more reliable. More...

#include <Glob.h>

Static Public Member Functions

static void glob (const std::string &pathPattern, std::set< std::string > &files, int options=0)
 Creates a set of files that match the given pathPattern.
 
static std::string globToRegex (const std::string &globPattern)
 Convert a glob pattern to an equivalent regular expression.
 

Static Public Attributes

static constexpr int GLOB_CASELESS = 4
 
static constexpr int GLOB_DEFAULT = 0
 Glob option constants (compatible with Poco::Glob)
 

Detailed Description

This Glob class uses the glob() method of Poco::Glob class to make it more reliable.

Author
Roman Tolchenov, Tessella plc
Date
23/07/2009

Definition at line 26 of file Glob.h.

Member Function Documentation

◆ glob()

void Mantid::Kernel::Glob::glob ( const std::string &  pathPattern,
std::set< std::string > &  files,
int  options = 0 
)
static

Creates a set of files that match the given pathPattern.

The path may be give in either Unix, Windows or VMS syntax and is automatically expanded by calling Path::expand().

The pattern may contain wildcard expressions even in intermediate directory names (e.g. /usr/include/* /**.h).

Note that, for obvious reasons, escaping characters in a pattern with a backslash does not work in Windows-style paths.

Directories that for whatever reason cannot be traversed are ignored.

It seems that whatever bug Poco had is fixed now. So calling Poco::Glob::glob(pathPattern,files,options) inside.

Parameters
pathPattern:: The search pattern as a string
files:: The names of the files that match the pattern
options:: Options

Definition at line 35 of file Glob.cpp.

Referenced by Mantid::Algorithms::ClearCache::deleteFiles(), Mantid::Kernel::ConfigServiceImpl::getFullPath(), and Mantid::DataHandling::LoadRawHelper::searchForLogFiles().

◆ globToRegex()

std::string Mantid::Kernel::Glob::globToRegex ( const std::string &  globPattern)
static

Convert a glob pattern to an equivalent regular expression.

This essentially converts non-escaped "*" to ".+" and non-escaped "?" to ".". This is how Poco's Glob module acts.

Definition at line 51 of file Glob.cpp.

Referenced by Mantid::Algorithms::GroupWorkspaces::addToGroup().

Member Data Documentation

◆ GLOB_CASELESS

constexpr int Mantid::Kernel::Glob::GLOB_CASELESS = 4
staticconstexpr

Definition at line 30 of file Glob.h.

Referenced by Mantid::API::FileFinderImpl::setCaseSensitive().

◆ GLOB_DEFAULT

constexpr int Mantid::Kernel::Glob::GLOB_DEFAULT = 0
staticconstexpr

Glob option constants (compatible with Poco::Glob)

Definition at line 29 of file Glob.h.

Referenced by Mantid::API::FileFinderImpl::FileFinderImpl(), Mantid::API::FileFinderImpl::getCaseSensitive(), and Mantid::API::FileFinderImpl::setCaseSensitive().


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