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 <TKey.h>
#include <TROOT.h>
#include <algorithm>
#include <cstring>
Include dependency graph for RFile.cxx:

Functions

static void CheckExtension (std::string_view path)
 
static RNameCycleResult DecodeNameCycle (std::string_view nameCycleRaw)
 
static ENameCycleError DecodeNumericCycle (const char *str, std::optional< std::int16_t > &out)
 
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

◆ CheckExtension()

static void CheckExtension ( std::string_view path)
static

Definition at line 31 of file RFile.cxx.

◆ DecodeNameCycle()

static RNameCycleResult DecodeNameCycle ( std::string_view nameCycleRaw)
static

Definition at line 84 of file RFile.cxx.

◆ DecodeNumericCycle()

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

Definition at line 66 of file RFile.cxx.

◆ ToString()

static const char * ToString ( ENameCycleError err)
static

Definition at line 59 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 137 of file RFile.cxx.