SLIC  6.1.1
Simulation for the Linear Collider (SLIC) - Geant4 simulation application
Static Public Member Functions | List of all members
FileUtil Class Reference

Utilities for file manipulation. More...

#include <FileUtil.hh>

Static Public Member Functions

static std::string basename (std::string filename)
 
static std::string extension (std::string filename)
 
static bool fileExists (const char *filename)
 
static bool fileExists (const std::string &filename)
 
static std::string removeExtension (std::string filename)
 
static int removeFile (const char *filename)
 
static int removeFile (const std::string &filename)
 

Detailed Description

Utilities for file manipulation.

Definition at line 13 of file FileUtil.hh.

Member Function Documentation

◆ basename()

std::string basename ( std::string  filename)
static

Get the base name of a file path, which has the directory stripped from it.

Parameters
[in]filenameFull path to a file.
Returns
The base name of the file.

Definition at line 40 of file FileUtil.cc.

Referenced by LcioFileNamer::makeFileBasedName().

◆ extension()

std::string extension ( std::string  filename)
static

Get the extension of a file.

Parameters
[in]filenameFull path to a file.
Returns
The extension of the file.

Definition at line 63 of file FileUtil.cc.

Referenced by EventSourceManager::setFilename().

◆ fileExists() [1/2]

bool fileExists ( const char *  filename)
static

Check if a file exists.

Parameters
[in]fileNameFull path to a file.
Returns
True if file exists; false if it does not.

Definition at line 22 of file FileUtil.cc.

Referenced by FileUtil::fileExists(), LcioManager::openLcioFile(), and EventSourceWithInputFile::setFilename().

◆ fileExists() [2/2]

bool fileExists ( const std::string &  filename)
static

Check if a file exists.

Parameters
[in]fileNameFull path string to a file.
Returns
True if file exists; false if it does not.

Definition at line 36 of file FileUtil.cc.

References FileUtil::fileExists().

◆ removeExtension()

std::string removeExtension ( std::string  filename)
static

Strip the extension from a file name.

Parameters
[in]filenameFull path to a file.
Returns
The file name with extension stripped off.

Definition at line 76 of file FileUtil.cc.

Referenced by LcioFileNamer::makeFileBasedName().

◆ removeFile() [1/2]

int removeFile ( const char *  filename)
static

Remove a file.

Parameters
[in]filenameFull path to a file.
Returns
Command status with non-zero indicating an error.

Definition at line 13 of file FileUtil.cc.

Referenced by LcioManager::openLcioFile(), and FileUtil::removeFile().

◆ removeFile() [2/2]

int removeFile ( const std::string &  filename)
static

Remove a file.

Parameters
[in]filenameFull path to a file.
Returns
Command status with non-zero indicating an error.

Definition at line 18 of file FileUtil.cc.

References FileUtil::removeFile().


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