KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVDatedFileManager Class Reference

Detailed Description

Handles a set of different versions of files with the same base name and a timestamp.

Read all versions of file with a given basename in directory and put them in a list sorted according to their timestamps. Environment variables (like $KVROOT) and other special symbols ('~') can be used in the directory name.

Definition at line 56 of file KVDatedFileManager.h.

#include <KVDatedFileManager.h>

Public Member Functions

 KVDatedFileManager ()
 
 KVDatedFileManager (const Char_t *base, const Char_t *dir)
 
virtual ~KVDatedFileManager ()
 
const Char_tGetOldestVersion ()
 Returns name of file with earliest timestamp.
 
const Char_tGetPreviousVersion (const Char_t *name)
 
void Update ()
 Updates list of files.
 

Private Member Functions

void ReadFiles ()
 

Private Attributes

KVString fBaseName
 the base name of the file
 
KVString fDirectory
 the directory containg the files
 
KVList fFileList
 list of files sorted by timestamp
 

Constructor & Destructor Documentation

◆ KVDatedFileManager() [1/2]

KVDatedFileManager::KVDatedFileManager ( )
inline

Definition at line 65 of file KVDatedFileManager.h.

◆ KVDatedFileManager() [2/2]

KVDatedFileManager::KVDatedFileManager ( const Char_t base,
const Char_t dir 
)

Read all versions of file with basename 'base' in directory 'dir' and put them in a list sorted according to their timestamps Environment variables ($KVROOT) and other special symbols ('~') can be used in the directory name.

Definition at line 25 of file KVDatedFileManager.cpp.

◆ ~KVDatedFileManager()

virtual KVDatedFileManager::~KVDatedFileManager ( )
inlinevirtual

Definition at line 67 of file KVDatedFileManager.h.

Member Function Documentation

◆ GetOldestVersion()

const Char_t * KVDatedFileManager::GetOldestVersion ( )

Returns name of file with earliest timestamp.

Definition at line 100 of file KVDatedFileManager.cpp.

◆ GetPreviousVersion()

const Char_t * KVDatedFileManager::GetPreviousVersion ( const Char_t name)

Returns name of file with timestamp immediately prior to the given name. Example: to know the name of the most recent backup version, give the base name of the file

If no older version exists, returns empty string

Definition at line 72 of file KVDatedFileManager.cpp.

◆ ReadFiles()

void KVDatedFileManager::ReadFiles ( )
private

Read all versions of file with given basename in directory and put them in a list sorted according to their timestamps

Definition at line 41 of file KVDatedFileManager.cpp.

◆ Update()

void KVDatedFileManager::Update ( )

Updates list of files.

Definition at line 112 of file KVDatedFileManager.cpp.

Member Data Documentation

◆ fBaseName

KVString KVDatedFileManager::fBaseName
private

the base name of the file

Definition at line 57 of file KVDatedFileManager.h.

◆ fDirectory

KVString KVDatedFileManager::fDirectory
private

the directory containg the files

Definition at line 58 of file KVDatedFileManager.h.

◆ fFileList

KVList KVDatedFileManager::fFileList
private

list of files sorted by timestamp

Definition at line 59 of file KVDatedFileManager.h.