Changeset 14069


Ignore:
Timestamp:
06/04/12 21:48:13 (12 years ago)
Author:
tbretz
Message:
Added something to the EventHook which allows to post command from the outside.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Readline.cc

    r14010 r14069  
    7474int         Readline::fScriptDepth = 0;
    7575std::string Readline::fScript;
     76std::string Readline::fExternalInput;
    7677
    7778// --------------------------------------------------------------------------
     
    307308void Readline::EventHook()
    308309{
     310    const string cpy = fExternalInput;
     311    fExternalInput = "";
     312
     313    if (!cpy.empty())
     314    {
     315        rl_replace_line(cpy.c_str(), 1);
     316        rl_done = 1;
     317    }
     318
    309319    const string p = GetUpdatePrompt();
    310320    if (p.empty())
  • trunk/FACT++/src/Readline.h

    r14057 r14069  
    3131    static int  fScriptDepth;
    3232    static bool fStopScript;
     33
     34    static std::string fExternalInput;
    3335
    3436    /// Static member function which are used to adapt readline to ncurses
     
    110112    static bool  IsScriptStopped() { return fStopScript; }
    111113    static int   GetScriptDepth() { return fScriptDepth; }
     114    static void  SetExternalInput(const std::string &inp) { fExternalInput = inp; }
    112115
    113116    static std::string GetScript() { return fScript; }
     117    static std::string GetExternalInput() { return fExternalInput; }
    114118
    115119    int GetLine() const { return fLine; }
Note: See TracChangeset for help on using the changeset viewer.