Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RFile.cxx File Reference
#include "ROOT/RFile.hxx"
#include <ROOT/StringUtils.hxx>
#include <ROOT/RError.hxx>
#include <Byteswap.h>
#include <TError.h>
#include <TFile.h>
#include <TIterator.h>
#include <TKey.h>
#include <TList.h>
#include <TROOT.h>
#include <algorithm>
#include <cstring>
Include dependency graph for RFile.cxx:

Functions

static RNameCycleResult DecodeNameCycle (std::string_view nameCycleRaw)
 
static ENameCycleError DecodeNumericCycle (const char *str, std::optional< std::int16_t > &out)
 
static void EnsureFileOpenAndBinary (const TFile *tfile, std::string_view path)
 
static std::string ReconstructFullKeyPath (const TKey &key)
 
static const char * ToString (ENameCycleError err)
 
static std::string ValidateAndNormalizePath (std::string &path)
 This function first validates, then normalizes the given path in place.
 

Function Documentation

◆ DecodeNameCycle()

static RNameCycleResult DecodeNameCycle ( std::string_view nameCycleRaw)
static

Definition at line 75 of file RFile.cxx.

◆ DecodeNumericCycle()

static ENameCycleError DecodeNumericCycle ( const char * str,
std::optional< std::int16_t > & out )
static

Definition at line 57 of file RFile.cxx.

◆ EnsureFileOpenAndBinary()

static void EnsureFileOpenAndBinary ( const TFile * tfile,
std::string_view path )
static

Definition at line 172 of file RFile.cxx.

◆ ReconstructFullKeyPath()

static std::string ReconstructFullKeyPath ( const TKey & key)
static

Definition at line 181 of file RFile.cxx.

◆ ToString()

static const char * ToString ( ENameCycleError err)
static

Definition at line 50 of file RFile.cxx.

◆ ValidateAndNormalizePath()

static std::string ValidateAndNormalizePath ( std::string & path)
static

This function first validates, then normalizes the given path in place.

Returns an empty string if path is a suitable path to store an object into a RFile, otherwise returns a description of why that is not the case.

A valid object path must:

  • not be empty
  • not contain the character '.'
  • not contain ASCII control characters or whitespace characters (including tab or newline).
  • not contain more than RFile::kMaxPathNesting path fragments (i.e. more than RFile::kMaxPathNesting - 1 '/')
  • not end with a '/'

In addition, when writing an object to RFile, the character ';' is also banned.

Passing an invalid path to Put will cause it to throw an exception, and passing an invalid path to Get will always return nullptr.

If required, path is modified to make its hierarchy-related meaning consistent. This entails:

  • combining any consecutive '/' into a single one;
  • stripping any leading '/'.

Definition at line 128 of file RFile.cxx.