Analysis-Utilities 26.9.9
C++/ROOT utilities for nuclear measurement data analysis
Loading...
Searching...
No Matches
IOUtils.hpp File Reference
#include <TFile.h>
#include <TString.h>
#include <TSystem.h>
Include dependency graph for IOUtils.hpp:

Go to the source code of this file.

Classes

class  IO::ScopedRootLock
 RAII guard engaging the same lock used by the open helpers. More...

Namespaces

namespace  IO
 Path-aware ROOT file helpers with optional thread-safe opening.

Functions

void IO::SetRootFilesBaseDir (const TString &dir)
 Set the base directory that relative subpaths resolve against.
TString IO::GetRootFilesBaseDir ()
 Current base directory for relative subpaths, without trailing slash.
void IO::SetThreadSafe (Bool_t enabled=kTRUE)
 Enable ROOT thread safety and serialise file opening.
Bool_t IO::IsThreadSafe ()
 Whether thread-safe file opening is currently engaged.
TFile * IO::OpenForReading (const TString &subpath)
 Open a ROOT file for reading, resolved against the base directory.
TFile * IO::OpenForWriting (const TString &subpath, const TString mode="RECREATE")
 Open a ROOT file for writing, creating parent directories first.