Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
ROOT::Experimental::Internal::REveAssetDir Class Reference

Directories of one kind of file the REve server serves under one http location prefix.

Directories of one kind of file the REve server serves under one http location prefix, such as the SDF fonts under "sdf-fonts/".

Private to REve; see the class documentation in the .cxx.

Not public API: REveText and REveLogo each hold one instance and expose its setters.

A file is looked up in the user directories, in the order they were set and added, then in the fallback directories, which hold files shipped with ROOT and may be read-only. The shipped files of a kind are in its subdirectory of GetAssetsDir(). The server serves a requested file from the first directory that has it. An optional write directory is where new files are written; it is created only when something is written.

Register() is the only place that passes the directories to the server. The setters call it, and the REveManager constructor calls RegisterAll(), so the directories can be set before REveManager::Create().

Definition at line 24 of file REveAssetDir.hxx.

Public Member Functions

 REveAssetDir (const REveAssetDir &)=delete
 
 REveAssetDir (const std::string &prefix)
 Constructor. prefix is the http location prefix, with a trailing slash.
 
 ~REveAssetDir ()
 Destructor.
 
void AddFallbackDir (const std::string &dir)
 Append dir to the fallback directories.
 
void AddUserDir (const std::string &dir)
 Append dir to the user directories.
 
std::string Find (const std::string &file) const
 Return the path of file in the first directory that has it, user directories first, or an empty string if none has it.
 
std::string FindPair (const std::string &file1, const std::string &file2) const
 Return the first directory that has file1 or file2 if it has both, else an empty string.
 
REveAssetDir & operator= (const REveAssetDir &)=delete
 
void Register () const
 Pass the directories to the server, user directories first, then fallback directories, each once.
 
void SetUserDir (const std::string &dir)
 Replace the user directories with dir.
 
std::string WritePath (const std::string &file) const
 Return the path to write file to, creating the write directory if it does not exist.
 
const std::string & GetPrefix () const
 Accessors; the directories passed in are normalized.
 
const std::vector< std::string > & GetUserDirs () const
 
const std::string & GetWriteDir () const
 
void SetWriteDir (const std::string &dir)
 

Static Public Member Functions

static std::string GetAssetsDir ()
 Return eve7/assets/ in the ui5 directory, where the build installs the RenderCore assets tarball.
 
static std::string GetUi5Dir ()
 Return the directory the server maps to "rootui5sys/", found as RWebWindowsManager finds it: $ROOTUI5SYS, else WebGui.RootUi5Path, else the ui5 directory in TROOT::GetDataDir().
 
static std::string NormalizeDir (const std::string &dir)
 Return dir with a trailing slash; an empty dir stays empty.
 
static void RegisterAll ()
 Register all instances. Called from the REveManager constructor.
 

Static Private Member Functions

static std::vector< REveAssetDir * > & Instances ()
 All existing instances, for RegisterAll().
 

Private Attributes

std::vector< std::string > fFallbackDirs
 shipped with ROOT, read-only, searched after fUserDirs
 
std::string fPrefix
 http location prefix, such as "sdf-fonts/"
 
std::vector< std::string > fUserDirs
 set by the user, searched first, in order
 
std::string fWriteDir
 where new files are written; empty if none
 

#include </github/home/ROOT-CI/src/graf3d/eve7/src/REveAssetDir.hxx>

Constructor & Destructor Documentation

◆ REveAssetDir() [1/2]

REveAssetDir::REveAssetDir ( const std::string & prefix)
explicit

Constructor. prefix is the http location prefix, with a trailing slash.

Definition at line 57 of file REveAssetDir.cxx.

◆ ~REveAssetDir()

REveAssetDir::~REveAssetDir ( )

Destructor.

Definition at line 65 of file REveAssetDir.cxx.

◆ REveAssetDir() [2/2]

ROOT::Experimental::Internal::REveAssetDir::REveAssetDir ( const REveAssetDir & )
delete

Member Function Documentation

◆ AddFallbackDir()

void REveAssetDir::AddFallbackDir ( const std::string & dir)

Append dir to the fallback directories.

Definition at line 128 of file REveAssetDir.cxx.

◆ AddUserDir()

void REveAssetDir::AddUserDir ( const std::string & dir)

Append dir to the user directories.

Definition at line 119 of file REveAssetDir.cxx.

◆ Find()

std::string REveAssetDir::Find ( const std::string & file) const

Return the path of file in the first directory that has it, user directories first, or an empty string if none has it.

Definition at line 138 of file REveAssetDir.cxx.

◆ FindPair()

std::string REveAssetDir::FindPair ( const std::string & file1,
const std::string & file2 ) const

Return the first directory that has file1 or file2 if it has both, else an empty string.

The server then serves both files from that directory, as it serves each file from the first directory that has it.

Definition at line 155 of file REveAssetDir.cxx.

◆ GetAssetsDir()

std::string REveAssetDir::GetAssetsDir ( )
static

Return eve7/assets/ in the ui5 directory, where the build installs the RenderCore assets tarball.

It has one subdirectory per kind of asset, the fallback directory of that kind.

Definition at line 102 of file REveAssetDir.cxx.

◆ GetPrefix()

const std::string & ROOT::Experimental::Internal::REveAssetDir::GetPrefix ( ) const
inline

Accessors; the directories passed in are normalized.

Definition at line 44 of file REveAssetDir.hxx.

◆ GetUi5Dir()

std::string REveAssetDir::GetUi5Dir ( )
static

Return the directory the server maps to "rootui5sys/", found as RWebWindowsManager finds it: $ROOTUI5SYS, else WebGui.RootUi5Path, else the ui5 directory in TROOT::GetDataDir().

Definition at line 86 of file REveAssetDir.cxx.

◆ GetUserDirs()

const std::vector< std::string > & ROOT::Experimental::Internal::REveAssetDir::GetUserDirs ( ) const
inline

Definition at line 45 of file REveAssetDir.hxx.

◆ GetWriteDir()

const std::string & ROOT::Experimental::Internal::REveAssetDir::GetWriteDir ( ) const
inline

Definition at line 46 of file REveAssetDir.hxx.

◆ Instances()

std::vector< REveAssetDir * > & REveAssetDir::Instances ( )
staticprivate

All existing instances, for RegisterAll().

Definition at line 48 of file REveAssetDir.cxx.

◆ NormalizeDir()

std::string REveAssetDir::NormalizeDir ( const std::string & dir)
static

Return dir with a trailing slash; an empty dir stays empty.

Definition at line 74 of file REveAssetDir.cxx.

◆ operator=()

REveAssetDir & ROOT::Experimental::Internal::REveAssetDir::operator= ( const REveAssetDir & )
delete

◆ Register()

void REveAssetDir::Register ( ) const

Pass the directories to the server, user directories first, then fallback directories, each once.

Does nothing before REveManager exists or when there are no directories.

Definition at line 187 of file REveAssetDir.cxx.

◆ RegisterAll()

void REveAssetDir::RegisterAll ( )
static

Register all instances. Called from the REveManager constructor.

Definition at line 213 of file REveAssetDir.cxx.

◆ SetUserDir()

void REveAssetDir::SetUserDir ( const std::string & dir)

Replace the user directories with dir.

Definition at line 110 of file REveAssetDir.cxx.

◆ SetWriteDir()

void ROOT::Experimental::Internal::REveAssetDir::SetWriteDir ( const std::string & dir)
inline

Definition at line 47 of file REveAssetDir.hxx.

◆ WritePath()

std::string REveAssetDir::WritePath ( const std::string & file) const

Return the path to write file to, creating the write directory if it does not exist.

Return an empty string if there is no write directory or it cannot be created.

Definition at line 173 of file REveAssetDir.cxx.

Member Data Documentation

◆ fFallbackDirs

std::vector<std::string> ROOT::Experimental::Internal::REveAssetDir::fFallbackDirs
private

shipped with ROOT, read-only, searched after fUserDirs

Definition at line 27 of file REveAssetDir.hxx.

◆ fPrefix

std::string ROOT::Experimental::Internal::REveAssetDir::fPrefix
private

http location prefix, such as "sdf-fonts/"

Definition at line 25 of file REveAssetDir.hxx.

◆ fUserDirs

std::vector<std::string> ROOT::Experimental::Internal::REveAssetDir::fUserDirs
private

set by the user, searched first, in order

Definition at line 26 of file REveAssetDir.hxx.

◆ fWriteDir

std::string ROOT::Experimental::Internal::REveAssetDir::fWriteDir
private

where new files are written; empty if none

Definition at line 28 of file REveAssetDir.hxx.

  • graf3d/eve7/src/REveAssetDir.hxx
  • graf3d/eve7/src/REveAssetDir.cxx