17#include "RConfigure.h"
44using namespace std::string_literals;
60 static std::map<std::string, std::unique_ptr<RWebDisplayHandle::Creator>> sMap;
73 auto search =
m.find(
name);
74 if (search ==
m.end()) {
76 if (libname ==
"ChromeCreator") {
77 m.emplace(
name, std::make_unique<ChromeCreator>(
name ==
"edge"));
78 }
else if (libname ==
"FirefoxCreator") {
79 m.emplace(
name, std::make_unique<FirefoxCreator>());
80 }
else if (libname ==
"BrowserCreator") {
81 m.emplace(
name, std::make_unique<BrowserCreator>(
false));
82 }
else if (!libname.empty()) {
86 search =
m.find(
name);
89 if (search !=
m.end())
90 return search->second;
92 static std::unique_ptr<RWebDisplayHandle::Creator> dummy;
128 gSystem->
Exec((
"taskkill /F /PID "s + std::to_string(
fPid) +
" >NUL 2>NUL").c_str());
129 std::string rmdir =
"rmdir /S /Q ";
133 std::string rmdir =
"rm -rf ";
151 if (exec.find(
"$url") == std::string::npos) {
154 fExec = exec +
" $url";
156 fExec = exec +
" $url &";
160 auto pos = exec.find(
" ");
161 if (pos != std::string::npos)
162 fProg = exec.substr(0, pos);
165 fExec =
"open \'$url\'";
167 fExec =
"start $url";
169 fExec =
"xdg-open \'$url\' &";
178 if (nexttry.empty() || !fProg.empty())
183 fProg = std::regex_replace(nexttry, std::regex(
"%20"),
" ");
190 if (!check_std_paths)
195 auto pos = ProgramFiles.find(
" (x86)");
196 if (pos != std::string::npos)
197 ProgramFiles.erase(pos, 6);
198 std::string ProgramFilesx86 =
gSystem->
Getenv(
"ProgramFiles(x86)");
200 if (!ProgramFiles.empty())
201 TestProg(ProgramFiles + nexttry,
false);
202 if (!ProgramFilesx86.empty())
203 TestProg(ProgramFilesx86 + nexttry,
false);
210std::unique_ptr<RWebDisplayHandle>
218 std::cout <<
"New web window: " << url << std::endl;
219 return std::make_unique<RWebBrowserHandle>(url,
"",
"");
226 exec = fHeadlessExec;
230 exec =
"$prog $url &";
235 std::string swidth = std::to_string(args.
GetWidth() > 0 ? args.
GetWidth() : 800),
237 sposx = std::to_string(args.
GetX() >= 0 ? args.
GetX() : 0),
238 sposy = std::to_string(args.
GetY() >= 0 ? args.
GetY() : 0);
240 ProcessGeometry(exec, args);
242 std::string rmdir = MakeProfile(exec, args.
IsHeadless());
244 exec = std::regex_replace(exec, std::regex(
"\\$url"), url);
245 exec = std::regex_replace(exec, std::regex(
"\\$width"), swidth);
246 exec = std::regex_replace(exec, std::regex(
"\\$height"), sheight);
247 exec = std::regex_replace(exec, std::regex(
"\\$posx"), sposx);
248 exec = std::regex_replace(exec, std::regex(
"\\$posy"), sposy);
250 if (exec.compare(0,5,
"fork:") == 0) {
261 if (!fargs || (fargs->GetLast()<=0)) {
266 std::vector<char *> argv;
267 argv.push_back((
char *) fProg.c_str());
268 for (
Int_t n = 0;
n <= fargs->GetLast(); ++
n)
269 argv.push_back((
char *)fargs->At(
n)->GetName());
270 argv.push_back(
nullptr);
272 R__LOG_DEBUG(0,
WebGUILog()) <<
"Show web window in browser with posix_spawn:\n" << fProg <<
" " << exec;
275 int status = posix_spawn(&pid, argv[0],
nullptr,
nullptr, argv.data(),
nullptr);
283 return std::make_unique<RWebBrowserHandle>(url, rmdir, pid);
293 exec =
"wmic process call create '"s +
gSystem->
UnixPathName(fProg.c_str()) + exec +
"' | find \"ProcessId\" "s;
295 std::stringstream ss(process_id);
299 ss >> tmp >>
c >> pid;
307 return std::make_unique<RWebBrowserHandle>(url, rmdir, pid);
313 if (exec.rfind(
"&") == exec.length() - 1) {
316 exec.resize(exec.length() - 1);
318 std::vector<char *> argv;
319 std::string firstarg = fProg;
320 auto slashpos = firstarg.find_last_of(
"/\\");
321 if (slashpos != std::string::npos)
322 firstarg.erase(0, slashpos + 1);
323 argv.push_back((
char *)firstarg.c_str());
326 for (
Int_t n = 1;
n <= fargs->GetLast(); ++
n)
327 argv.push_back((
char *)fargs->At(
n)->GetName());
328 argv.push_back(
nullptr);
334 return std::make_unique<RWebBrowserHandle>(url, rmdir,
""s);
342 std::string prog = std::regex_replace(fProg, std::regex(
" "),
"\\ ");
344 std::string prog = fProg;
349 exec = std::regex_replace(exec, std::regex(
"\\$prog"), prog);
353 if (!redirect.empty()) {
354 auto p = exec.length();
355 if (exec.rfind(
"&") ==
p-1) --
p;
356 exec.insert(
p,
" >"s + redirect +
" "s);
364 if (!redirect.empty()) {
371 return std::make_unique<RWebBrowserHandle>(url, rmdir, dump_content);
390 TestProg(
"\\Microsoft\\Edge\\Application\\msedge.exe",
true);
392 TestProg(
"\\Google\\Chrome\\Application\\chrome.exe",
true);
395 TestProg(
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome");
399 TestProg(
"/usr/bin/chromium-browser");
400 TestProg(
"/usr/bin/chrome-browser");
401 TestProg(
"/usr/bin/google-chrome-stable");
411 bool use_normal =
true;
417 fBatchExec =
gEnv->
GetValue((
fEnvPrefix +
"Batch").c_str(),
"$prog --headless --no-sandbox --no-zygote --disable-extensions --disable-gpu --disable-audio-output $geometry $url");
418 fHeadlessExec =
gEnv->
GetValue((
fEnvPrefix +
"Headless").c_str(),
"$prog --headless --no-sandbox --no-zygote --disable-extensions --disable-gpu --disable-audio-output $geometry \'$url\' --dump-dom >/dev/null &");
421 fBatchExec =
gEnv->
GetValue((
fEnvPrefix +
"Batch").c_str(),
"$prog --headless=new --no-sandbox --no-zygote --disable-extensions --disable-gpu --disable-audio-output $geometry $url");
422 fHeadlessExec =
gEnv->
GetValue((
fEnvPrefix +
"Headless").c_str(),
"$prog --headless=new --no-sandbox --no-zygote --disable-extensions --disable-gpu --disable-audio-output $geometry \'$url\' &");
443 geometry.append(
"--window-position="s + std::to_string(args.
GetX() >= 0 ? args.
GetX() : 0) +
","s +
444 std::to_string(args.
GetY() >= 0 ? args.
GetY() : 0));
452 exec = std::regex_replace(exec, std::regex(
"\\$geometry"),
geometry);
461 std::string rmdir, profile_arg;
463 if (exec.find(
"$profile") == std::string::npos)
466 const char *chrome_profile =
gEnv->
GetValue((fEnvPrefix +
"Profile").c_str(),
"");
467 if (chrome_profile && *chrome_profile) {
468 profile_arg = chrome_profile;
471 std::string rnd_profile =
"root_chrome_profile_"s + std::to_string(
gRandom->
Integer(0x100000));
475 profile_arg +=
"\\"s + rnd_profile;
477 profile_arg +=
"/"s + rnd_profile;
482 exec = std::regex_replace(exec, std::regex(
"\\$profile"), profile_arg);
496 TestProg(
"\\Mozilla Firefox\\firefox.exe",
true);
499 TestProg(
"/Applications/Firefox.app/Contents/MacOS/firefox");
511 fExec =
gEnv->
GetValue(
"WebGui.FirefoxInteractive",
"$prog -no-remote $profile $url &");
513 fBatchExec =
gEnv->
GetValue(
"WebGui.FirefoxBatch",
"$prog --headless --private-window --no-remote $profile $url");
515 fExec =
gEnv->
GetValue(
"WebGui.FirefoxInteractive",
"$prog --private-window \'$url\' &");
524 std::string rmdir, profile_arg;
526 if (exec.find(
"$profile") == std::string::npos)
529 const char *ff_profile =
gEnv->
GetValue(
"WebGui.FirefoxProfile",
"");
530 const char *ff_profilepath =
gEnv->
GetValue(
"WebGui.FirefoxProfilePath",
"");
532 if (ff_profile && *ff_profile) {
533 profile_arg =
"-P "s + ff_profile;
534 }
else if (ff_profilepath && *ff_profilepath) {
535 profile_arg =
"-profile "s + ff_profilepath;
536 }
else if ((ff_randomprofile > 0) || (batch_mode && (ff_randomprofile >= 0))) {
539 std::string rnd_profile =
"root_ff_profile_"s + std::to_string(
gRandom->
Integer(0x100000));
543 profile_dir +=
"\\"s + rnd_profile;
545 profile_dir +=
"/"s + rnd_profile;
548 profile_arg =
"-profile "s + profile_dir;
554 std::ofstream user_js(profile_dir +
"/user.js", std::ios::trunc);
555 user_js <<
"user_pref(\"browser.dom.window.dump.enabled\", true);" << std::endl;
557 user_js <<
"user_pref(\"datareporting.policy.dataSubmissionPolicyAcceptedVersion\", 2);" << std::endl;
558 user_js <<
"user_pref(\"datareporting.policy.dataSubmissionPolicyNotifiedTime\", \"1635760572813\");" << std::endl;
566 exec = std::regex_replace(exec, std::regex(
"\\$profile"), profile_arg);
579 std::unique_ptr<RWebDisplayHandle> handle;
584 auto try_creator = [&](std::unique_ptr<Creator> &creator) {
585 if (!creator || !creator->IsActive())
587 handle = creator->Display(args);
588 return handle ? true :
false;
592 if (try_creator(
FindCreator(
"cef",
"libROOTCefDisplay")))
597 if (try_creator(
FindCreator(
"qt5",
"libROOTQt5WebDisplay")))
602 if (try_creator(
FindCreator(
"qt6",
"libROOTQt6WebDisplay")))
616 if (try_creator(
FindCreator(
"edge",
"ChromeCreator")))
622 if (try_creator(
FindCreator(
"chrome",
"ChromeCreator")))
627 if (try_creator(
FindCreator(
"firefox",
"FirefoxCreator")))
637 std::unique_ptr<Creator> creator = std::make_unique<BrowserCreator>(
false, args.
GetCustomExec());
638 try_creator(creator);
640 try_creator(
FindCreator(
"browser",
"BrowserCreator"));
678 bool detected =
false;
681 if (
h1 &&
h1->IsActive()) {
687 auto &h2 =
FindCreator(
"firefox",
"FirefoxCreator");
688 if (h2 && h2->IsActive()) {
697 if (h3 && h3->IsActive()) {
708 return h1 &&
h1->IsActive();
712 auto &h2 =
FindCreator(
"firefox",
"FirefoxCreator");
713 return h2 && h2->IsActive();
719 return h3 && h3->IsActive();
748bool RWebDisplayHandle::ProduceImages(
const std::string &fname,
const std::vector<std::string> &jsons,
const std::vector<int> &widths,
const std::vector<int> &heights,
const char *batch_file)
753 std::string _fname = fname;
754 std::transform(_fname.begin(), _fname.end(), _fname.begin(), ::tolower);
755 auto EndsWith = [&_fname](
const std::string &suffix) {
756 return (_fname.length() > suffix.length()) ? (0 == _fname.compare(_fname.length() - suffix.length(), suffix.length(), suffix)) :
false;
759 std::vector<std::string> fnames;
761 if (!EndsWith(
".pdf")) {
762 bool has_quialifier = _fname.find(
"%") != std::string::npos;
764 if (!has_quialifier && (jsons.size() > 1)) {
765 _fname.insert(_fname.rfind(
"."),
"%d");
766 has_quialifier =
true;
769 for (
unsigned n = 0;
n < jsons.size();
n++) {
770 if (has_quialifier) {
772 fnames.emplace_back(expand_name.Data());
774 fnames.emplace_back(_fname);
779 if (EndsWith(
".json")) {
780 for (
unsigned n = 0;
n < jsons.size(); ++
n) {
781 std::ofstream ofs(fnames[
n]);
795 jsrootsys = jsrootsysdflt.
Data();
807 std::string draw_kind;
809 if (EndsWith(
".pdf"))
811 else if (EndsWith(
"shot.png") && (jsons.size() == 1))
812 draw_kind = isChromeBased ?
"draw" :
"png";
813 else if (EndsWith(
".svg"))
815 else if (EndsWith(
".png"))
817 else if (EndsWith(
".jpg") || EndsWith(
".jpeg"))
819 else if (EndsWith(
".webp"))
824 if (!batch_file || !*batch_file)
825 batch_file =
"/js/files/canv_batch.htm";
834 if (filecont.empty()) {
839 int max_width = 0, max_height = 0, page_margin = 10;
840 for (
auto &
w : widths)
843 for (
auto &
h : heights)
851 for (
auto &
json : jsons) {
852 mains.append(mains.empty() ?
"[" :
", ");
857 if (strstr(jsrootsys,
"http://") || strstr(jsrootsys,
"https://") || strstr(jsrootsys,
"file://"))
858 filecont = std::regex_replace(filecont, std::regex(
"\\$jsrootsys"), jsrootsys);
860 filecont = std::regex_replace(filecont, std::regex(
"\\$jsrootsys"),
"file://"s + jsrootsys);
862 filecont = std::regex_replace(filecont, std::regex(
"\\$page_margin"), std::to_string(page_margin) +
"px");
863 filecont = std::regex_replace(filecont, std::regex(
"\\$page_width"), std::to_string(max_width + 2*page_margin) +
"px");
864 filecont = std::regex_replace(filecont, std::regex(
"\\$page_height"), std::to_string(max_height + 2*page_margin) +
"px");
866 filecont = std::regex_replace(filecont, std::regex(
"\\$draw_kind"), draw_kind);
867 filecont = std::regex_replace(filecont, std::regex(
"\\$draw_widths"), jsonw.Data());
868 filecont = std::regex_replace(filecont, std::regex(
"\\$draw_heights"), jsonh.Data());
869 filecont = std::regex_replace(filecont, std::regex(
"\\$draw_objects"), mains);
872 if (draw_kind ==
"draw") {
873 if (!isChromeBased) {
877 }
else if (isChromeBased || isFirefox) {
878 dump_name =
"canvasdump";
884 fputs(
"placeholder", df);
890 static bool chrome_tmp_workaround =
false;
903 R__LOG_DEBUG(0,
WebGUILog()) <<
"Using file content_len " << filecont.length() <<
" to produce batch images " << fname;
906 tmp_name =
"canvasbody";
912 fputs(filecont.c_str(), hf);
915 html_name = tmp_name +
".html";
917 if (chrome_tmp_workaround) {
919 auto pos = html_name.
Last(
'/');
924 html_name = homedir + html_name.
Data();
928 std::ofstream ofs(html_name.
Data(), std::ofstream::out);
941 R__LOG_DEBUG(0,
WebGUILog()) <<
"Using " << html_name <<
" content_len " << filecont.length() <<
" to produce batch images " << fname;
949 args.
SetSize(widths[0], heights[0]);
951 if (draw_kind ==
"draw") {
953 TString tgtfilename = fname.c_str();
957 wait_file_name = tgtfilename;
959 if (EndsWith(
".pdf"))
967 }
else if (isFirefox) {
971 }
else if (isChromeBased) {
989 if (html_name.
Length() > 0)
997 if (draw_kind !=
"draw") {
999 auto dumpcont = handle->GetContent();
1001 if ((dumpcont.length() > 20) && (dumpcont.length() < 60) && !chrome_tmp_workaround && isChromeBased) {
1004 chrome_tmp_workaround =
true;
1008 if (dumpcont.length() < 100) {
1013 if (draw_kind ==
"svg") {
1015 std::string::size_type
p = 0;
1017 for (
auto & fn : fnames) {
1018 auto p1 = dumpcont.find(
"<svg",
p);
1019 auto p2 = dumpcont.find(
"</svg></div>", p1 + 4);
1021 std::ofstream ofs(fn);
1022 if ((p1 != std::string::npos) && (p2 != std::string::npos) && (p1 < p2)) {
1023 ofs << dumpcont.substr(p1, p2-p1+6);
1024 ::Info(
"ProduceImage",
"SVG file %s size %d bytes has been created", fn.c_str(), (
int) (p2-p1+6));
1027 ofs <<
"Failure!!!\n" << dumpcont;
1033 std::string::size_type
p = 0;
1035 for (
auto &fn : fnames) {
1037 auto p1 = dumpcont.find(
";base64,",
p);
1038 auto p2 = dumpcont.find(
"></div>", p1 + 4);
1041 if ((p1 != std::string::npos) && (p2 != std::string::npos) && (p1 < p2)) {
1043 auto base64 = dumpcont.substr(p1+8, p2-p1-9);
1046 std::ofstream ofs(fn, std::ios::binary);
1047 ofs.write(binary.Data(), binary.Length());
1049 ::Info(
"ProduceImage",
"Image file %s size %d bytes has been created", fn.c_str(), (
int) binary.Length());
1057 }
else if (EndsWith(
".pdf")) {
1058 ::Info(
"ProduceImage",
"PDF file %s with %d pages has been created", fname.c_str(), (
int) jsons.size());
1061 if (fnames.size() == 1)
#define R__LOG_ERROR(...)
#define R__LOG_DEBUG(DEBUGLEVEL,...)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
R__EXTERN TRandom * gRandom
R__EXTERN TSystem * gSystem
Specialized handle to hold information about running browser process Used to correctly cleanup all pr...
RWebBrowserHandle(const std::string &url, const std::string &tmpdir, browser_process_id pid)
std::string fTmpDir
temporary directory to delete at the end
RWebBrowserHandle(const std::string &url, const std::string &tmpdir, const std::string &dump)
~RWebBrowserHandle() override
Holds different arguments for starting browser with RWebDisplayHandle::Display() method.
std::string GetBrowserName() const
Returns configured browser name.
EBrowserKind GetBrowserKind() const
returns configured browser kind, see EBrowserKind for supported values
const std::string & GetRedirectOutput() const
get file name to which web browser output should be redirected
void SetStandalone(bool on=true)
Set standalone mode for running browser, default on When disabled, normal browser window (or just tab...
void SetBatchMode(bool on=true)
set batch mode
RWebDisplayArgs & SetSize(int w, int h)
set preferable web window width and height
RWebDisplayArgs & SetUrl(const std::string &url)
set window url
int GetWidth() const
returns preferable web window width
RWebDisplayArgs & SetPageContent(const std::string &cont)
set window url
int GetY() const
set preferable web window y position
std::string GetFullUrl() const
returns window url with append options
bool IsStandalone() const
Return true if browser should runs in standalone mode.
int GetHeight() const
returns preferable web window height
RWebDisplayArgs & SetBrowserKind(const std::string &kind)
Set browser kind as string argument.
std::string GetCustomExec() const
returns custom executable to start web browser
void SetExtraArgs(const std::string &args)
set extra command line arguments for starting web browser command
bool IsBatchMode() const
returns batch mode
bool IsHeadless() const
returns headless mode
@ kDefault
default system web browser, can not be used in batch mode
@ kFirefox
Mozilla Firefox browser.
@ kNative
either Chrome or Firefox - both support major functionality
@ kLocal
either CEF or Qt5 - both runs on local display without real http server
@ kServer
indicates that ROOT runs as server and just printouts window URL, browser should be started by the us...
@ kOff
disable web display, do not start any browser
@ kCEF
Chromium Embedded Framework - local display with CEF libs.
@ kQt5
Qt5 QWebEngine libraries - Chromium code packed in qt5.
@ kQt6
Qt6 QWebEngine libraries - Chromium code packed in qt6.
@ kCustom
custom web browser, execution string should be provided
@ kChrome
Google Chrome browser.
@ kEdge
Microsoft Edge browser (Windows only)
void SetRedirectOutput(const std::string &fname="")
specify file name to which web browser output should be redirected
void SetHeadless(bool on=true)
set headless mode
const std::string & GetExtraArgs() const
get extra command line arguments for starting web browser command
int GetX() const
set preferable web window x position
bool IsLocalDisplay() const
returns true if local display like CEF or Qt5 QWebEngine should be used
std::string fProg
browser executable
std::string fBatchExec
batch execute line
std::string fHeadlessExec
headless execute line
std::unique_ptr< RWebDisplayHandle > Display(const RWebDisplayArgs &args) override
Display given URL in web browser.
std::string fExec
standard execute line
void TestProg(const std::string &nexttry, bool check_std_paths=false)
Check if browser executable exists and can be used.
BrowserCreator(bool custom=true, const std::string &exec="")
Class to handle starting of web-browsers like Chrome or Firefox.
ChromeCreator(bool is_edge=false)
Constructor.
void ProcessGeometry(std::string &, const RWebDisplayArgs &args) override
Replace $geometry placeholder with geometry settings Also RWebDisplayArgs::GetExtraArgs() are appende...
std::string MakeProfile(std::string &exec, bool) override
Handle profile argument.
FirefoxCreator()
Constructor.
std::string MakeProfile(std::string &exec, bool batch) override
Create Firefox profile to run independent browser window.
Handle of created web-based display Depending from type of web display, holds handle of started brows...
static std::map< std::string, std::unique_ptr< Creator > > & GetMap()
Static holder of registered creators of web displays.
static bool CheckIfCanProduceImages(RWebDisplayArgs &args)
Checks if configured browser can be used for image production.
static bool ProduceImages(const std::string &fname, const std::vector< std::string > &jsons, const std::vector< int > &widths, const std::vector< int > &heights, const char *batch_file=nullptr)
Produce image file(s) using JSON data as source Invokes JSROOT drawing functionality in headless brow...
void SetContent(const std::string &cont)
set content
static bool ProduceImage(const std::string &fname, const std::string &json, int width=800, int height=600, const char *batch_file=nullptr)
Produce image file using JSON data as source Invokes JSROOT drawing functionality in headless browser...
static bool CanProduceImages(const std::string &browser="")
Returns true if image production for specified browser kind is supported If browser not specified - u...
static bool DisplayUrl(const std::string &url)
Display provided url in configured web browser.
static std::unique_ptr< RWebDisplayHandle > Display(const RWebDisplayArgs &args)
Create web display.
static std::unique_ptr< Creator > & FindCreator(const std::string &name, const std::string &libname="")
Search for specific browser creator If not found, try to add one.
static TString Decode(const char *data)
Decode a base64 string date into a generic TString.
static TString ToJSON(const T *obj, Int_t compact=0, const char *member_name=nullptr)
@ kNoSpaces
no new lines plus remove all spaces around "," and ":" symbols
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
static char * ReadFileContent(const char *filename, Int_t &len)
Reads content of file from the disk.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
virtual void SetSeed(ULong_t seed=0)
Set the random generator seed.
virtual UInt_t Integer(UInt_t imax)
Returns a random integer uniformly distributed on the interval [ 0, imax-1 ].
void Clear()
Clear string without changing its capacity.
const char * Data() const
Ssiz_t Last(char c) const
Find last occurrence of a character c.
TObjArray * Tokenize(const TString &delim) const
This function is used to isolate sequential tokens in a TString.
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual int mkdir(const char *name, Bool_t recursive=kFALSE)
Make a file system directory.
virtual Int_t Exec(const char *shellcmd)
Execute a command.
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual FILE * TempFileName(TString &base, const char *dir=nullptr)
Create a secure temporary file by appending a unique 6 letter string to base.
virtual std::string GetHomeDirectory(const char *userName=nullptr) const
Return the user's home directory.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual int Rename(const char *from, const char *to)
Rename a file.
virtual TString GetFromPipe(const char *command)
Execute command and return output in TString.
virtual Bool_t IsAbsoluteFileName(const char *dir)
Return true if dir is an absolute pathname.
virtual const char * WorkingDirectory()
Return working directory.
virtual int Unlink(const char *name)
Unlink, i.e.
virtual const char * TempDirectory() const
Return a user configured or systemwide directory to create temporary files in.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
ROOT::Experimental::RLogChannel & WebGUILog()
Log channel for WebGUI diagnostics.