Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:23

0001 // @(#)root/rint:$Id$
0002 // Author: Rene Brun   17/02/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 
0013 #ifndef ROOT_TRint
0014 #define ROOT_TRint
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // Rint                                                                 //
0019 //                                                                      //
0020 // Rint is the ROOT Interactive Interface. It allows interactive access //
0021 // to the ROOT system via a C++ interpreter.                            //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "TApplication.h"
0026 #include "TString.h"
0027 
0028 class TFileHandler;
0029 
0030 
0031 class TRint : public TApplication {
0032 
0033 private:
0034    Int_t         fNcmd;               // command history number
0035    TString       fDefaultPrompt;      // default prompt: "root [%d] "
0036    TString       fNonContinuePrompt;  // default prompt before continue prompt was set
0037    char          fPrompt[64];         // interpreter prompt
0038    Bool_t        fInterrupt;          // if true macro execution will be stopped
0039    Int_t         fCaughtSignal;       // TRint just caught a signal
0040    TFileHandler *fInputHandler;       // terminal input handler
0041    Bool_t        fBackslashContinue{};// whether the last line ended with '\'
0042 
0043    TRint(const TRint&) = delete;
0044    TRint& operator=(const TRint&) = delete;
0045 
0046    void    ExecLogon();
0047    Longptr_t ProcessRemote(const char *line, Int_t *error = nullptr) override;
0048    Longptr_t ProcessLineNr(const char* filestem, const char *line, Int_t *error = nullptr);
0049 
0050 public:
0051    TRint(const char *appClassName, Int_t *argc, char **argv, void *options = nullptr, Int_t numOptions = 0,
0052          Bool_t noLogo = kFALSE, Bool_t exitOnUnknownArgs = kFALSE);
0053    virtual             ~TRint();
0054    virtual char       *GetPrompt();
0055    virtual const char *SetPrompt(const char *newPrompt);
0056            void        SetEchoMode(Bool_t mode) override;
0057            void        HandleException(Int_t sig) override;
0058            Bool_t      HandleTermInput() override;
0059    virtual void        PrintLogo(Bool_t lite = kFALSE);
0060            void        Run(Bool_t retrn = kFALSE) override;
0061    virtual void        Terminate(int status) override;
0062            void        Interrupt() { fInterrupt = kTRUE; }
0063            Int_t       TabCompletionHook(char *buf, int *pLoc, std::ostream& out) override;
0064 
0065    TFileHandler       *GetInputHandler() { return fInputHandler; }
0066 
0067    ClassDefOverride(TRint,0);  //ROOT Interactive Application Interface
0068 };
0069 
0070 #endif