__________________________________________________[C++IMPLEMENTATION] Name: utils/src/TMrbSystem.cxx Purpose: MARaBOU utilities: Some extensions to TSystem class Description: Implements extended methods for TSystem Keywords: Author: R. Lutter Mailto: <a href=mailto:rudi.lutter@physik.uni-muenchen.de>R. Lutter</a> Revision: $Id: TMrbSystem.cxx,v 1.23 2008/04/14 08:30:57 Otto.Schaile Exp $ Date:
| TMrbSystem() | |
| TMrbSystem(const TMrbSystem&) | |
| virtual | ~TMrbSystem() |
| void | TObject::AbstractMethod(const char* method) const |
| void | AddIncludePath(const Char_t* IncludePath) |
| virtual void | TObject::AppendPad(Option_t* option = "") |
| virtual void | TObject::Browse(TBrowser* b) |
| Bool_t | ChangeDirectory(const Char_t* Path) const |
| Bool_t | CheckExtension(const Char_t* FileName, const Char_t* Extension) const |
| static TClass* | Class() |
| virtual const char* | TObject::ClassName() const |
| virtual void | TObject::Clear(Option_t* = "") |
| virtual TObject* | TObject::Clone(const char* newname = "") const |
| virtual Int_t | TObject::Compare(const TObject* obj) const |
| virtual void | TObject::Copy(TObject& object) const |
| virtual void | TObject::Delete(Option_t* option = "")MENU |
| virtual Int_t | TObject::DistancetoPrimitive(Int_t px, Int_t py) |
| virtual void | TObject::Draw(Option_t* option = "") |
| virtual void | TObject::DrawClass() constMENU |
| virtual TObject* | TObject::DrawClone(Option_t* option = "") constMENU |
| virtual void | TObject::Dump() constMENU |
| virtual void | TObject::Error(const char* method, const char* msgfmt) const |
| virtual void | TObject::Execute(const char* method, const char* params, Int_t* error = 0) |
| virtual void | TObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0) |
| virtual void | TObject::ExecuteEvent(Int_t event, Int_t px, Int_t py) |
| Bool_t | Exists(const Char_t* Path) const |
| virtual void | TObject::Fatal(const char* method, const char* msgfmt) const |
| Int_t | FindFile(TObjArray& PathList, const Char_t* FileName, const Char_t* SearchPath = "", Bool_t MultipleMatch = kFALSE) const |
| virtual TObject* | TObject::FindObject(const char* name) const |
| virtual TObject* | TObject::FindObject(const TObject* obj) const |
| const Char_t* | GetBaseName(TString& FileName, const Char_t* FilePath) const |
| const Char_t* | GetDirName(TString& DirName, const Char_t* FilePath, TMrbSystem::EMrbDirMode Mode = kMrbDirAsIs) const |
| const Char_t* | GetDomainName(TString& DomainName) |
| virtual Option_t* | TObject::GetDrawOption() const |
| static Long_t | TObject::GetDtorOnly() |
| const Char_t* | GetExtension(TString& Extension, const Char_t* FileName) const |
| const Char_t* | GetHostName(TString& HostName) |
| virtual const char* | TObject::GetIconName() const |
| const Char_t* | GetIncludePath() |
| virtual const char* | TObject::GetName() const |
| virtual char* | TObject::GetObjectInfo(Int_t px, Int_t py) const |
| static Bool_t | TObject::GetObjectStat() |
| virtual Option_t* | TObject::GetOption() const |
| const Char_t* | GetRelPath(TString& Path, const Char_t* BaseDir = 0) const |
| Bool_t | GetStat(TMrbLofNamedX& StatBuf, const Char_t* Path) |
| const Char_t* | GetSymbolicLink(TString& SymLink, const Char_t* Path) |
| virtual const char* | TObject::GetTitle() const |
| Int_t | GetType(const Char_t* Path) const |
| virtual UInt_t | TObject::GetUniqueID() const |
| virtual Bool_t | TObject::HandleTimer(TTimer* timer) |
| Bool_t | HasExecutePermission(const Char_t* Path) const |
| virtual ULong_t | TObject::Hash() const |
| Bool_t | HasReadPermission(const Char_t* Path) const |
| Bool_t | HasWritePermission(const Char_t* Path) const |
| void | Help() |
| virtual void | TObject::Info(const char* method, const char* msgfmt) const |
| virtual Bool_t | TObject::InheritsFrom(const char* classname) const |
| virtual Bool_t | TObject::InheritsFrom(const TClass* cl) const |
| virtual void | TObject::Inspect() constMENU |
| void | TObject::InvertBit(UInt_t f) |
| virtual TClass* | IsA() const |
| Bool_t | IsDirectory(const Char_t* Path) const |
| virtual Bool_t | TObject::IsEqual(const TObject* obj) const |
| Bool_t | IsExecutable(const Char_t* Path) const |
| virtual Bool_t | TObject::IsFolder() const |
| Bool_t | TObject::IsOnHeap() const |
| Bool_t | IsRegular(const Char_t* Path) const |
| Bool_t | IsSameFile(const Char_t* Path1, const Char_t* Path2) |
| virtual Bool_t | TObject::IsSortable() const |
| Bool_t | IsSymbolicLink(const Char_t* Path) const |
| Bool_t | TObject::IsZombie() const |
| Int_t | Load(const char* LofModules, Bool_t SystemFlag = kFALSE) |
| virtual void | TObject::ls(Option_t* option = "") const |
| void | TObject::MayNotUse(const char* method) const |
| virtual Bool_t | TObject::Notify() |
| void | TObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const |
| static void | TObject::operator delete(void* ptr) |
| static void | TObject::operator delete(void* ptr, void* vp) |
| static void | TObject::operator delete[](void* ptr) |
| static void | TObject::operator delete[](void* ptr, void* vp) |
| void* | TObject::operator new(size_t sz) |
| void* | TObject::operator new(size_t sz, void* vp) |
| void* | TObject::operator new[](size_t sz) |
| void* | TObject::operator new[](size_t sz, void* vp) |
| TMrbSystem& | operator=(const TMrbSystem&) |
| virtual void | TObject::Paint(Option_t* option = "") |
| virtual void | TObject::Pop() |
| virtual void | TObject::Print(Option_t* option = "") const |
| void | PrintLoadPath(Int_t Status, const Char_t* Module, const Char_t* Path = "", const Char_t* Entry = "", Bool_t SystemFlag = kFALSE) |
| virtual Int_t | TObject::Read(const char* name) |
| virtual void | TObject::RecursiveRemove(TObject* obj) |
| void | TObject::ResetBit(UInt_t f) |
| virtual void | TObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU |
| virtual void | TObject::SavePrimitive(ostream& out, Option_t* option = "") |
| void | TObject::SetBit(UInt_t f) |
| void | TObject::SetBit(UInt_t f, Bool_t set) |
| virtual void | TObject::SetDrawOption(Option_t* option = "")MENU |
| static void | TObject::SetDtorOnly(void* obj) |
| void | SetIncludePath(const Char_t* IncludePath) |
| static void | TObject::SetObjectStat(Bool_t stat) |
| virtual void | TObject::SetUniqueID(UInt_t uid) |
| virtual void | ShowMembers(TMemberInspector& insp) |
| virtual void | Streamer(TBuffer& b) |
| void | StreamerNVirtual(TBuffer& b) |
| virtual void | TObject::SysError(const char* method, const char* msgfmt) const |
| Bool_t | TObject::TestBit(UInt_t f) const |
| Int_t | TObject::TestBits(UInt_t f) const |
| virtual void | TObject::UseCurrentStyle() |
| virtual void | TObject::Warning(const char* method, const char* msgfmt) const |
| const Char_t* | Which(TString& Result, const Char_t* Search, const Char_t* File, EAccessMode Mode = kFileExists) |
| const Char_t* | WorkingDirectory() const |
| virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) |
| virtual Int_t | TObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const |
| Bool_t | CheckAccess(const Char_t* Path, EAccessMode Mode) const |
| Bool_t | CheckType(const Char_t* Path, TMrbSystem::EMrbFileType Type) const |
| virtual void | TObject::DoError(int level, const char* location, const char* fmt, va_list va) const |
| void | TObject::MakeZombie() |
| enum EMrbFileType { | kMrbRegularFile | |
| kMrbDirectory | ||
| kMrbSymbolicLink | ||
| kMrbCharDev | ||
| kMrbBlockDev | ||
| kMrbFifo | ||
| kMrbSocket | ||
| kMrbExecutable | ||
| }; | ||
| enum EMrbDirMode { | kMrbDirAsIs | |
| kMrbDirAppendSlash | ||
| kMrbDirReturnDot | ||
| kMrbDirExpandWdir | ||
| }; | ||
| enum TObject::EStatusBits { | kCanDelete | |
| kMustCleanup | ||
| kObjInCanvas | ||
| kIsReferenced | ||
| kHasUUID | ||
| kCannotPick | ||
| kNoContextMenu | ||
| kInvalidObject | ||
| }; | ||
| enum TObject::[unnamed] { | kIsOnHeap | |
| kNotDeleted | ||
| kZombie | ||
| kBitMask | ||
| kSingleKey | ||
| kOverwrite | ||
| kWriteDelete | ||
| }; |

________________________________________________________________[C++ METHOD] Name: TMrbSystem::FindFile Purpose: Find file(s) along a search path Arguments: TObjArray & PathList -- resulting path list Char_t * FileName -- file name, may be wild-carded Char_t * SearchPath -- unix search path (:-separated) Bool_t MultipleMatch -- kTRUE if multiple hits requested Results: Int_t NofFiles -- number of files found Exceptions: NofFiles = -1 -- error NofFiles = 0 -- no file found Description: Returns a list of file paths for a given file name. Files will be APPENDED to list. Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetDirName Purpose: Return directory part of file path Arguments: TString & DirName -- restulting dir name Char_t * FilePath -- full path spec EMrbDirMode Mode -- how to return directory name Results: Char_t * DirName -- directory name (same as DirName.Data()) Exceptions: Description: Returns "dir part" of a string. ~ and $ constructs will be expanded before execution Additional options: Mode = kMrbDirAppendSlash -- append / at end of string = kMrbDirExpandWdir -- expand working directory Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetBaseName Purpose: Return file name part of file path Arguments: TString & BaseName -- resulting file name Char_t * FilePath -- full path spec Results: Char_t * BaseName -- file name part (same as BaseName.Data()) Exceptions: Description: Returns "file name part" of given string. Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetExtension Purpose: Return extension part of file name Arguments: TString & Extension -- resulting extension Char_t * FileName -- file spec Results: Char_t * Extension -- extension part (same as Extension.Data()) Exceptions: Description: Returns extension (including ".") Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::CheckExtension Purpose: Check if file has a given extension Arguments: Char_t * FileName -- file spec Char_t * Extension -- extension Results: kTRUE/kFALSE Exceptions: Description: Checks file for a given extension. Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetRelPath Purpose: Get relative path name Arguments: TString & Path -- full path name Char_t * BaseDir -- base directory Results: Char_t * RelPath -- relative path Exceptions: Description: Returns path name as seen from base dir. Default base dir is current working dir. Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetType Purpose: Return file type Arguments: const Char_t * Path -- path name Results: Int_t Type -- file type Exceptions: Description: Returns file type Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::CheckAccess Purpose: Check file permission Arguments: const Char_t * Path -- path name Results: kTRUE/kFALSE Exceptions: Description: Checks file permission bits Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetSymbolicLink Purpose: Return symbolic link Arguments: TString & SymLink -- Where to store link info Char_t * Path -- path name Results: Char_t * SymLink -- where the link is pointing to Exceptions: Description: Returns symbolic link information Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::Which Purpose: TSystem::Which(), improved Arguments: TString & Result -- resulting path Char_t * Search -- unix-like search path, :-separated Char_t * File -- file name to be searched for EAccessMode Mode -- access mode Results: Char_t * ResPath -- same as Result.Data() Exceptions: Description: Performs TSystem::Which(). Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::Load Purpose: TSystem::Load() + Printout Arguments: Char_t * LofModules -- library module to be loaded Bool_t SystemFlag -- kTRUE if it is a system lib Results: Int_t Status -- -1, 0, 1 Exceptions: Description: Performs TSystem::Load and prints result Argument 'LofModules' is expected to be a :-separated list of library modules: lib1:lib2:.... An entry point may be specified by appending it in parens: lib1(entry1):lib2(entry2) Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::PrintLoadPath Purpose: Print load path to cout Arguments: Int_t Status -- result of TSystem::Load() Char_t * Module -- library module to be loaded CHar_t * Path -- path library was found on Char_t * Entry -- lib entry to be searched for Bool_t SystemFlag -- kTRUE if it is a system lib Results: -- Exceptions: Description: Outputs load path to cout. Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::AddIncludePath Purpose: Append an item to $IncludePath Arguments: Char_t * IncludePath -- include path Exceptions: Description: Adds a string to include defs IncludePath may be a :-separated string Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetHostName Purpose: Get host name Arguments: TString & HostName -- where to store host name Exceptions: Description: Executes gethostname(2), returns name of current host Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetDomainName Purpose: Get domain name Arguments: TString & DomainName -- where to store domain name Exceptions: Description: Executes getdomainname(2), returns name of current host Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetStat Purpose: Get file stat bits Arguments: TMrbLofNamedX & StatBuf -- where to store stat bits Char_t * Path -- file path Exceptions: Description: Executes stat(2) and returns stat bits Keywords:
________________________________________________________________[C++ METHOD] Name: TMrbSystem::GetStat Purpose: Get file stat bits Arguments: Char_t * Path1 -- file path #1 Char_t * Path2 -- file path #2 Exceptions: Description: Compares inodes. Keywords:
{ return(this->CheckType(Path, TMrbSystem::kMrbRegularFile)); }{ return((this->GetType(Path) & TMrbSystem::kMrbExecutable) != 0); }{ return(this->CheckType(Path, TMrbSystem::kMrbDirectory)); }{ return(this->CheckType(Path, TMrbSystem::kMrbSymbolicLink)); }{ return(this->CheckAccess(Path, kReadPermission)); }{ return(this->CheckAccess(Path, kWritePermission)); }{ return(this->CheckAccess(Path, kExecutePermission)); }{ return((this->GetType(Path) & Type) == Type); }